I'm just starting to learn both HTML and CSS and am having problems with pseudo elements in firefox.
In the CSS file I've got
Now, using IE7 this displays as expected, but in Firefox 3.0 the first line of the div is displayed the same as the rest of the block i.e not uppercase.Code:div.content:first-line{text-transform: uppercase;}
I know there are differences between browsers, but the book I'm following suggests that this should work in both IE and FF and googling doesn't seem to show that anyone else has the same problem.
Any ideas?
I have never seen the use of a colon in the name.
I would give the first few words a class of their own. It does not seem cross browser compatible.
I usually do this by CSS.
According to w3schools this should work in all major browsers.
CSS :first-line pseudo-element
I'm getting quite frustrated with this now.
Think I've got it sorted now. In my html file I had something along the lines of
It would appear that IE still picks up the content of the paragraph as the first line of the div but firefox (and opera) does not. If I remove the <p> then it displays correctly in FF.Code:<div class="content"><p>Random paragraph of text</p></div>
I guess the solution is to ensure that the first paragraph of the div either doesn't use <p> tags or to apply the pseudo element to the first paragraph rather than the div.
Right that's the chapter on basic CSS finished. Onto Javascript next.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks