Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Type but not IDs

Posted on 2014-12-09
4
Medium Priority
?
64 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

604 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