Solved

Type but not IDs

Posted on 2014-12-09
4
59 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…

813 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