Jump to content

Padding help


Recommended Posts

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 post
Share on other sites

----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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...