简体   繁体   中英

HTML link to CSS style sheet not working

<!DOCTYPE html>
<html>
  <head>
    <title> A Level Computing </title>
    <link rel="stylesheet" type="text/css" href="College Work/Computing/homework2part3.css">
  </head>
  <body>
  <div class='row headingrow'>
    <div class='grid-d-1'> <h1> AS Theory</h1></div>
    <div class='grid-d-1'> <h1> AS Programming</h1></div>
    <div class='grid-d-1'><img src='pictures/menu_logo.png'
                                alt='Computing'/></div>
    <div class='grid-d-1'> <h1> A2 Theory</h1></div>
    <div class='grid-d-1'> <h1> A2 Programming</h1></div>
 </div>
    </body>
</html>

And my CSS code is:

* { 
    box-sizing: border-box
}

[class*="grid-"] {
    width: 100%;
    float: left;
}

@ media only screen and (min-width: 768px) {
    /* For Desktop*/
    .grid-d-1{width: 20%}
    .grid-d-1{width: 25%}
    .grid-d-1{width: 100%}
} 

.row:after {
    content: "";
    clear: both;
    display: block;
}

My HTML webpage isn't being altered like it should be and i think its down to my linking between the html and css. Also my image isnt coming up. It may be down to my file directory. The code is not completely finished yet just so you know.

I think it has something to do with my file directory as my images ( i have added another) arent coming up.

One problem is you have three values for the same class

.grid-d-1{width: 20%}
.grid-d-1{width: 25%}
.grid-d-1{width: 100%}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM