How to capitalize first line with css? ::first-line psuedo-element CSS not working


Tags: css,css-selectors,line,pseudo-element,capitalize

Problem :

Right now I've got a paragraph and I'd like to capitalize the entire first line. I've set the first paragraph to an id "firstp" and tried:

#firstp:first-line {
    text-transform: uppercase;
}

I've tried it with text-transform: capitalize but that doesn't work either. It's strange because I've managed to change the first letter (changed font size) using #firstp:first-letter.



Solution :

text-transform on :first-line is really buggy right now, see the reference here http://reference.sitepoint.com/css/text-transform

You can use this jquery plugin called linify https://github.com/octopi/Linify to select the first line and then apply the property of text-transform: uppercase

Regards,


    CSS Howto..

    How to create a border that fully covers the adjacent corners in CSS?

    how to replace a link name text

    How to get bean property on css file?

    How to load CSS on PC and Mobile by jQuery?

    how can resize the page? [closed]

    How to give effect on dragging in css or through jquery

    how do i css position this divs according to my layout picture?

    How to move the second child in my nav menu with CSS

    CSS(3): How to display elements after each other

    How to make div to expand vertically without using overflow or javascript or hardcoded values such as margins

    How do I center bootstrap's carousel? Not the images, the carousel itself

    How can I prevent the textarea from stretching beyond his parent DIV element? (google-chrome issue only)

    How do I center align the items in my menu?

    How to apply css and elemental styles to a ASP.net MVC 3 Web Application

    CSS- how to give an object with scooped corners a border colour?

    How to show/hide big image by clicking on thumbnails?

    CSS: How to make background of an element stretch across the entire page?

    How can I get rid of the the gap below absolutely positioned content?

    What's causing my hover image not to show it's transparency? [closed]

    how to text zoom effect in css

    How to stop an image shrinking on responsive site whilst also keeping it centred

    How to use easeOutBounce animiation on display block?

    CSS: How to ignore an element so parent's padding will accomodate to other elements?

    How do I add a link to my CSS background?

    I have a simple image picture slider with JQuery, but I do not know how to animate up or down

    How to set width correctly in CSS - Need to fix bug with Safari on Mac and on iPad

    How to center this flip card example?

    How to get WordPress Twenty Ten theme sub-menus to expand to their contents (CSS)?

    Can't figure out how to code my css

    CSS - How to set gradient color background for different heights