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 fix layout to browser window without scroll

    How to extract r, g, b, a values from CSS color?

    CSS How to use margins with different divs

    Using `.toggle()` rather than applying a class to show content

    How do i get css3pie to work on all Joomla 2.5 pages not just default page

    How to get CSS table-cell to 100% for responsive design [closed]

    How to remove spacing between the top of a border and a div [closed]

    How to change element properties on hover with CSS in following case

    How to expand an abbreviated word onhover in html via css or javascript or even using jquery?

    How to reset parent child relationship between nested div

    How do I hide the parent of a nested list while keeping the nested list visible?

    How to move items left and right in an html table using css? -

    how to route to css/js files in mvc.net

    How To Make Two Container Heights Match?

    How to stop background layering with CSS?

    how to get text beside image button using CSS

    How to specify a path to be followed while animating an object in HTML using CSS, JQuery

    How to wrap text to fill a DIV (like in MS-Excel) [duplicate]

    How to put a div in more pages

    How to Style Unique CSS Navigation Menu

    how to display tabs in more than one row having the extra tabs coming one row up rather than one row below?

    How do I switch my CSS stylesheet using jQuery?

    CSS menu list items need to show inside div container

    how does CSS float property combine when dealing with nested divs?

    how to flip and rotate an image using css in chrome

    Bootstrap - How to make text wrap around an image on small devices?

    Compass delimited list separator - how to set to – [duplicate]

    Showing/hiding content with jQuery

    CSS Flex Box: How to vertically align “flex items” to middle without losing flex item height?

    How to reference a Div after each h3