Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:19:17+00:00 2026-06-06T05:19:17+00:00

I have a div[class=container] and inside is div[class=item] like: <style type=text/css> .container{ height:50vh; width:

  • 0

I have a div[class=”container”] and inside is div[class=”item”] like:

<style type="text/css">
.container{
    height:50vh;
    width: 32vw;
    text-align: center;
    color: #fff;
    /*padding: 30px;*/
    border: 1px solid rgba(0, 0, 0, 0.13);
}

.imgitem {
    height:100%; /*tried with "calc(50vh - 60px)" too*/
    width: 100%;
}
</style>
<div class="container">
    <div class="imgitem">
        <img src="flower_img.png" style="max-height:100%; max-width:100%" />
    </div>
</div>

What I was expecting is The “container” should preserve width(32vw) and height(50vh) as given in the CSS. But as soon as I’m adding padding to container, its size increases.

Now What I want to achieve is:

  1. The outer container should be of given width and height.
  2. There must be padding of 30px for the container. Container width/height shouldn’t increase after padding.
  3. The inner div with the class “imgitem” should have the the remaining width(32vw – 30px -30px) which I mean (container:width – container:padding-left – container:padding-right). Same is with height.

For the layout I am attaching an image:
layout

Can anyone help me out with this.
I already spent whole day doing this but have nothing.

[ITS SPECIFIC TO IE10, metro apps]

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:19:19+00:00Added an answer on June 6, 2026 at 5:19 am

    you can use the css3 -moz-box-sizing: border-box; property for your desired results and it will not affect your width & height…with the use of padding…

    HTML

    <div>demo demo</div>
    

    CSS

    div {
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box;    /* Firefox, other Gecko */
    box-sizing: border-box;         /* Opera/IE 8+ */
        background: none repeat scroll 0 0 red;
        height: 150px;
        padding: 10px;
        width: 150px;
    }
    

    see the demo:- http://jsfiddle.net/qpdsZ/10/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have div container and inside couple div with class demo and gravity like
I have something like this in my page: <div id=test> <div class=item>Test</div> <div class=item>Test</div>
I have a div container with class embed and unique id. Inside the container
Usually when I have floating elements inside a container div, I'll have something like
I have the fallowing markup: <div class=container> <div style=display:none>1</div> <div style=display:none>2</div> <div style=display:none>3</div> </div>
I have an image <div class='container'> <img src='../images.jpg' alt='images' /> </div> I want to
i have got <div><a class='link' href='index.php' data-container='target'>Load</a></div> <div class='target'></div> i need to write jquery
I have an div element in website markup as follows. <div id=mainContainer class=container runat=server>
I have code similar to the following: <div class=container> <div class=overlay> // hover content
I have implemented the carousel on my webpage as follows <div class=container-fluid> <div id=myCarousel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.