How can I exclude certain elements from css property that has been applied to their parent without using the style attribute


Tags: html,css

Problem :

my table is auto generated so I can't give it classes. All i can do is white general css like the following

td{white-space:nowrap}
a{white-space:normal}

How can I give the text1 normal white-space but nowrap for text 2 and text 3?

<tr>
<td>
<a href=""...>text 1</a>
</td>
<td>
text 2
</td>
<td>
text3
</td
</tr>


Solution :

if your link is always on first cell of your row you could solve with

tr td:first-child { white-space : nowrap }
a { white-space : normal }

(I have no other clues for different solutions)


    CSS Howto..

    CKEditor 4: How to add CSS stylesheet from plugin?

    How to center without losing it's function

    How to prevent span from growing with content

    How to get rid of !important tags?

    I can not load the CSS pages which can be accessed after a login carry with spring security. How can I fix it?

    How do you close the CSS preview view in Eclipse?

    How to apply css to three different classes hovering one of them

    Change image src for product “showoff”

    How are CSS properties implemented by different browsers? [closed]

    How to detect CSS translate3d without the webkit context?

    How can we control the size of a special character?

    How can I set CSS only for specific IE browsers?

    Is this how CSS LESS and SimpLESS work? [closed]

    How can I change this HAML format to normal CSS style?

    How to concatenate and minify multiple CSS and JavaScript files with Grunt.js (0.3.x)

    How to combine php send mail forms with a list of image click?

    How do I overlay text on an image who's size is to be set?

    how to align the content of a box

    Main navigation, classes on/off. HGelp understanding how this is built

    How To Move A DIV Element A Little Towards The Top

    How to add multiple style rules to css pseudo elements using js?

    How to put JavaScript from tutorial into my website?

    How can I use CSS to show and hide multiple elements at once?

    Tag image in svg invisible in FireFox because of using style. How to fix?

    How to align images in a mosaic style? html/css

    How can I get 3 lines of text on the same line and still be able to position them?

    How to place something in a triangle-shaped box?

    How to fix maximum width of a div? If contents of that div's exceeds than maximum width, we get scroller?

    show css icon with select icon class selcetbox

    How to use CSS position(relative, absolute) with percentage (height, width) dimension? [closed]