Home > Software design >  How to fix at rule or selector expected?
How to fix at rule or selector expected?

Time:12-11

What is wrong with my css code? There is a problem on the first and last lines. I'm a complete newbie :)

Error Messages: at-rule or selector expected (ln 1, Col 1) at-rule or selector expected (ln 51, Col 1)

`

\<style\>
p {
font-family: Arial;
margin-top: 0;
margin-bottom: 0;
}

    .video-title {
        font-weight: bold;
        font-size: 18px;
        width: 280px;
        line-height: 24px;
        margin-bottom: 5;
    } 
    
    .video-stats {
        font-size: 14px;
        color: rgb(96, 96, 96);
        margin-bottom: 20px;
    }
    
    .video-author {
        font-size: 14px;
        color: rgb(96, 96, 96);
        margin-bottom: 20;
    
    }
    
    .video-description {
        font-size: 14px;
        color: rgb(96, 96, 96);
        width: 280px;
        line-height: 22px;
        margin-bottom: 100px;
    }
    
    .apple-text {
        margin-bottom: 50px;
        font-size: 14px;
        background-color: rgb(227, 65, 64);
        color: white;
        text-align: center;
        padding: 20px;
    }
    
    .shop-now:hover {
        text-decoration: underline;
        cursor: pointer;
    }

\</style\>

`

I tried checking semi colons and comparing other "OK" css codes and cant seem to find the error on line 1 and 51.

CodePudding user response:

There is something wrong with your <style> tags

/ in tags is for informing where tag ends, so you don't really put your CSS into tags

First line should look like this <style> and last one like this </style>

Also it might be a good idea to extract this code into separate .css file and include it into HTML

CodePudding user response:

Are you including that CSS in a HTML file or separately in a CSS file?

If it's in a HTML file, then the selectors that surround the CSS should be <style> and </style>. Your code shows some backslashes which shouldn't be there.

If it's in a CSS file, then you don't need the <style> tags.

  •  Tags:  
  • css
  • Related