Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS not selector

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #278387
    Drakcio
    Participant

    In div i got h1,so my question is if i can rule out h1 from div declarations by using not selector?

    :not(h1) {
    (something like this);
    }   
    

    @media(min-width: 600px)
    {

    div *{
        font-size:2.8vw; 
    }
    
    
        aside{
    display:block;
        }
    

    }

    #278388
    Paulie_D
    Member

    It depends on what it is you are trying to do.

    This…

    :not(h1) {
    (something like this);
    }   
    

    …doesn’t target h1 at all. it targets everything except h1 tags.

    #278389
    Beverleyh
    Participant

    I would suggest you’d want div :not(h1) to target everything inside the div, except for the h1, but the code you posted isn’t making your requirements very clear.

    To help us along, try making a simple CodePen demo to show us what you’re trying to do and what you’re having problems with.

    #278390
    Drakcio
    Participant

    Im mean, h1 that is in Div selector scales to font size too what makes it really small,so im just asking is there anyway to rule out h1 form there.

    div *{
    font-size:2.8vw;
    }

    I know i can make this by taking * from div but that woudl be a lot of work.

    If what im saying is not clear i can post the code.

    #278391
    Drakcio
    Participant

    https://imgur.com/a/zWgk9rF Before 600px
    https://imgur.com/a/CZnsMFp After 600px
    Maybe this will help in understanding what i mean

    #278393
    Beverleyh
    Participant

    I think our answers have already given you all the information you need to move forward;

    • read the answers that have already been given to you
    • try out the suggestions from the answers in a small demo (CodePen, JSBin, JSFiddle, or similar)
    • assess if the suggestions are doing what you’d expect
    • if they are not doing what you expect, show us what they are doing instead by posting a link to your demo
    #278399
    Drakcio
    Participant

    Div * :not(h1)
    {
    font-size:2.8vw;
    }

    Thats the anwser,thanks for help

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.