box model issue

Just wanted to ask when tackling the box model hack, you need to take into consideration margin, padding and border values for the box/container, but what about values for declarations for /p/ and /a/ etc when you add padding to these.

For example
<p class="long">
<p class="short">

.long
{ padding: 0 40px}

.short
{ padding: 0 10px}

Will this play havoc on your box/container?




Shouldn't do. I assume you are worried about the padding and margin pushing your containers out of shape?

Yes thats right, I was wondering if the additional m/p placed on other tags inside the <div> would effect the box. It was just a passing thought. Thanks

if you had your <p> tag at width:100% then probably it would be a problem

Wouldn't that be a bit of a weird thing to do? There are a few issues once you start adding p/m to width:100%

Yeah it would I guess. I've never done it.

But it's the only way it would stretch things (from what I gather).

I saw someone had this problem the other day somewhere with <ul>

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options