left-margin + ems (10)

1 Name: #!/usr/bin/anonymous : 2008-02-24 01:56 ID:rpyMXtGJ

hey anons, just trying to solve a should-be simple problem
of dimensioning in css. i'm leaning away from coding 'div
soup' html for not-too-complex sites in favor of (x)html's
built in semantics. this should be easy:

<h1>title</h1>

<h2>subtitle</h2>

<h3>news</h3>

<p>
<span>news entry</span>
<span>mm.dd.yy</span>
this is a news entry. blo blo blo about my site.
</p>

i'm trying to make h3 and p have an equal left-margin/padding
without using px or %. i want to use ems but the problem is
they're relative to whatever element they are targeting. for
instance:

h3,p {margin-left:3em}

..one will be pushed far to the right than the other. is there
any way to negate this relativity so that they both align
equally? i would like to know if this is possible without
nesting it any more html.

2 Name: #!/usr/bin/anonymous : 2008-02-24 05:59 ID:Heaven

>>1
div does exist for a reason.

3 Name: #!/usr/bin/anonymous : 2008-02-24 09:21 ID:Heaven

>>1

Each news entry in a div with title, date, author, etc. each in an appropriately class'ed p.

4 Name: #!/usr/bin/anonymous : 2008-02-24 13:26 ID:d6nezlnV

Adding a section-grouping div is acceptable in this situation.

This is why XHTML2 has an actual "section" element.

5 Name: #!/usr/bin/anonymous : 2008-02-24 17:18 ID:Heaven

Yeah, XHTML2 has a lot of nifty stuff -- like being able to put an href= on anything, rather than just having a link element. I'm not sure why they didn't do that in the first place.

6 Name: #!/usr/bin/anonymous : 2008-02-24 20:22 ID:rpyMXtGJ

>>5
yeah, can't wait for that. not only href, you can also apply a src to any element. this is really great for creating navigation.

its too bad we're seeing html5.

7 Name: #!/usr/bin/anonymous : 2008-02-25 06:56 ID:CEAl52+R

THREAD HIJACKED. This thread is now about how we love/hate XHTML2/HTML5

8 Name: #!/usr/bin/anonymous : 2008-02-25 07:39 ID:Heaven

( ゚ ヮ゚) THREAD HIJACKED. This thread is now about how well mittens are supported in XHTML2/HTML5!

9 Name: #!/usr/bin/anonymous : 2008-02-25 11:57 ID:Heaven

( ゚ ヮ゚) MITON GA SUKI!

10 Name: #!/usr/bin/anonymous : 2008-02-29 20:36 ID:Heaven

( ゚ ヮ゚) <mittens>are awesome</mittens>

This thread has been closed. You cannot post in this thread any longer.