Are there any CSS standards that I should follow while writing my first stylesheet?

前端 未结 17 639
有刺的猬
有刺的猬 2020-12-13 02:40

I am currently working on my first website. I have no idea where to start on the CSS page, or if there are any standards that I should be following.

I would appreci

17条回答
  •  遥遥无期
    2020-12-13 03:25

    Alot of people have some excellent suggestions. I would like to second what codeinthewhole said.

    I would strongly recommend using a reset.css style-sheet:

    *{margin:0;padding:0}iframe,a img,fieldset,form,table{border:0}h6,h5,h4,h3,h2,h1,caption,th,td{font-size:100%;font-weight:normal}dd,dt,li,dl,ol,ul{list-style:none}legend{color:#000}button,select,textarea,input{font:100% serif}table{border-collapse:collapse}caption,th,td{text-align:left}p, h1{margin:0;padding:0;bording:0}
    

    Either copy and paste or just save the one i linked to.

    Also, a mistake i used in my early days was over use of

    apposed to
    . An id="" is only supposed to be used once (never have two
    's), whereas you can have thousands of class="" (like
    ).

    And besides, having more than one id with the same name isnt valid html

提交回复
热议问题