Solved

Type but not IDs

Posted on 2014-12-09
4
56 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
Comment Utility
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
Comment Utility
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Bootstrap 3 and Angular 2 12 20
CSS help matching specific span class 2 20
Wordpress CSS Link Issue 2 13
HTML CSS 7 14
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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 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 tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

771 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

12 Experts available now in Live!

Get 1:1 Help Now