- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Howdy,
I’m trying to target the first p tag inside a DIV, which is the container for blog content. There’s markup before it, such as another div or an image.
#content_container > p {} works well to target the paragraphs within the container, but not the ones that are captions of another div, etc.
title
this caption shouldn't be touched
.................
.................
But I can’t seem to target JUST the first (or last) paragraph within the #content_container.
Thoughts?
#content_container > p:first-of-type {} works, but is unsupported up until MSIE9. There has to be an easier way to remove the margin at the top of the first paragraph w/o marking up the content. My only hope is JS? http://ie7-js.googlecode.com/svn/test/index.html
div#content_container > div + p { : ;}
the generic div tag can be changed to the id name of the div with photo depending if you’re going to have other divs followed by paragraphs later on in your #content_container.
Thanks for the brain power! Yes, the copy on the page is full of paragraphs with div tags between them, so something along those lines would certainly have to be specific.
just use javascript. its so easy i don’t, know why people are afraid of it. =/
Indeed. Will have ie7.js on the page for PNG transparency, so might as well.