This is a discussion on "Applying style to first para only" within the Web Page Design section. This forum, and the thread "Applying style to first para only are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Applying style to first para only
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Applying style to first para only
Hi,
I've looked through a good few tutorials and CSS reference guides, and tried searching for this problem but had no luck. Basically, I'm designing a Joomla template, and the paragraph I am trying to style is part of the generated content so I have no access to the html, so I can add a class. There are 2 paragraphs within a <td>, and the first one is a heading, so I would like to style that seperately from the second paragraph, which is the content. Am I right in thinking there is a way of only applying style to the first instance of a tag within another tag? Or have I just made that up? Any help greatly appreciated! Thanks! |
|
|
|
#2
|
||||
|
||||
|
Re: Applying style to first para only
You can't edit the html? That kind of screws you up a bit when trying to style only one paragraph. Can you post the generated html code?
|
|
#3
|
|||
|
|||
|
Re: Applying style to first para only
Yeah tell me about it, 2 second job to sort if I could edit the HTML!
|
|
#4
|
||||
|
||||
|
Re: Applying style to first para only
Can "<p>Latest event</p>" not be changed to something like "<h2>Latest event</h2>"? Then you could style the h2 or whatever.
|
|
#5
|
|||
|
|||
|
Re: Applying style to first para only
No, unfortunately not. The furthest into the above code that I have control over the HTML is to the <div class="bg"> tag.
I had it in my head that were was a way of applying a style to the first instance of a tag only. But after a whole lot of searching I can't find anything, so I'm starting to think I've imagined reading it before!! Cheers for the replies. |
|
#6
|
||||
|
||||
|
Re: Applying style to first para only
Yeah I've googled it a couple of times and I can't find anything.
|
|
#7
|
||||
|
||||
|
Re: Applying style to first para only
http://www.w3.org/TR/REC-CSS2/selector.html
These will help you, but they're support is extremely limited. No go in IE. If you can add JavaScript, you can do it with that. Otherwise, you're out of luck. |
![]() |
| Tags |
| first, instance, styling, tag |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to tell IE7 to use a pariticular style in a single style sheet | figo2476 | Web Page Design | 5 | May 25th, 2007 15:23 |
| Font Color Not Applying! Please Help!! | tobymather | Web Page Design | 9 | Apr 14th, 2007 00:59 |
| Rollover behaviour applying to whole div-HELP | tobymather | Web Page Design | 7 | Apr 14th, 2007 00:52 |
| Dreamweaver Templates - applying to batch pages | wheatus | Web Page Design | 0 | Apr 15th, 2004 13:18 |