?
Solved

Type but not IDs

Posted on 2014-12-09
4
Medium Priority
?
63 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
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 to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Suggested Courses

764 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