Solved

Type but not IDs

Posted on 2014-12-09
4
58 Views
Last Modified: 2014-12-11
Im wondering if its possible to style all my labels on a page, but not those of a particular ID:-
eg:-
    label :not(#lblTypeCompany) :not(#lblTypeVinci) {
        width:200px;
        background-color:blue;
    }

Open in new window


I know the above code doesnt work, but hopefully it will describe what Im doing.

Going forward I could say 'not default style' as something like:-
    label :not(.defaultStyle) {
        width:200px;
        background-color:blue;
    }

Open in new window


But obviously I dont know if this is even possible yet.

Thank you
0
Comment
Question by:tonelm54
  • 3
4 Comments
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40488699
you can do the first thing, but not the second thing.

label:not(#lblTypeCompany),
label:not(#lblTypeVinci) {
        width:200px;
        background-color:blue;
    }

You might be able to do the second thing with a preprocessor like SASS
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40488706
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40489239
Both are fine but remove the spaces

    label:not(#lblTypeCompany):not(#lblTypeVinci) {
        width:200px;
        background-color:blue;
    }


    label:not(.defaultStyle) {
        width:200px;
        background-color:blue;
    }

Open in new window

0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40490349
please clarify whst you mean by "not(.defaultstyle)"

what Gary is suggesting is that labels which do not have the "defaultStyle" class will get the specified properties.

but if what you're looking for is to remove some styling defined by the .defaultStyle{} rule somewhere in the css file, then such syntax does not exist in plain CSS
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Menu Inconsistent 3 33
CSS change width browser switches to mobile view 2 53
Remove greater than sign 3 44
Not seen Link button 5 15
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now