CSS

Yay I take the time to learn front end programming! So many fun things to do in life :)

To get rid of default margin around everything set body margin to 0 at the start. That zeros everything.

To set css on a tag: use tag-name {} for a class use .class-name {} and for an id use #id-name {}.

body {
    margin: 0;
}
 
header {
    background-color: #4a4a4a;
    color: blanchedalmond;
    text-align: center;
    padding: 25px 0;
    margin-bottom: 25px;
}
 
main {
    background-color: #e4e4e4;
    width: 600px;
    padding: 25px;
    border: solid 5px red;
    margin: 100px auto;
}
 
footer {
    background-color: #4a4a4a;
    color: blanchedalmond;
    text-align: center;
    padding: 25px 0;
    margin-top: 25px; 
}
  • css.txt
  • Last modified: 2020/10/06 06:15
  • by paul