zanfranceschi Posted January 27, 2006 Share Posted January 27, 2006 Hi there,When I determine the width and padding for a div, firefox and internet explorer render it differently. Firefox seems to add the padding value to the width, while IE doesn't.Is there a way to IE and Firefox render the div with the same width with padding using CSS?Thanks---edited---I'm not getting to edit the post title... wanted to add "solved"---/edited--- Link to comment Share on other sites More sharing options...
johnmendel Posted January 27, 2006 Share Posted January 27, 2006 there is. If done correctly, they should look identical. I had a similar problem. 9/10 times is a problem with your code. Post what you are working with, so the problem can be pointed out. Link to comment Share on other sites More sharing options...
zanfranceschi Posted January 27, 2006 Author Share Posted January 27, 2006 ----EDITED-----Got it to work with an workaround...Simply place another div inside the div you want with padding (now, set no padding) and set the border for the nested div, it works great!!!Here are the codes: .post { border: 1px solid #CCC; background: #444; width: 380px; margin: 0 0 10px 0;}.postPadding { border: 5px solid #444;}.postTitle { font-size: 14px; font-weight: bold; color: #F90; margin: 0 0 10px 10px;}.postDate { font-size: 9px; color: #F90; margin: 0 0 0 10px;} <div class="post"><div class="postPadding"> <div class="postTitle"> Novo Layout<br /> <span class="postDate">[ 25/01/2006 - 04:02 ]</span> </div> <div class="postPost">Novo layout de novo; mais simples e sóbrio. Aderi também aos padrões XHTML da W3C.</div></div> </div> -----/EDITED-----old post bellow:.post, .projetos are divs where .postTitle, .projetosProject and .postDate, .projetosDate are nested in (.postDate is actually a span).See them here: http://www.zanfranceschi.com.br/ <div class="post"> <div class="postTitle"> Novo Layout<br /> <span class="postDate">[ 25/01/2006 - 04:02 ]</span> </div> <div class="postPost">Novo layout de novo; mais simples e sóbrio. Aderi também aos padrões XHTML da W3C.</div> </div> .post, .projetos { border: 1px solid #CCC; background: #444; width: 380px; margin: 0 0 10px 0; padding: 5px; }.postTitle, .projetosProject { font-size: 14px; font-weight: bold; color: #F90; margin: 0 0 10px 10px;}.postDate, .projetosDate { font-size: 9px; color: #F90; margin: 0 0 0 10px;} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now