Willkommen bei Schnipsel, Code Schnipsel zu Wordpress, PHP, HTML, CSS, jQuery und so weiter...

Simlper CSS Reset

05.2009 / von: David Hellmann / 9 Kommentare / Kategorie: CSS / Tags: ,

Es macht Sinn ein paar Sachen in einer neuen CSS Datei zu resetten. Aber nicht jedes Element einzeln sondern einfach ein paar grundlegende Dinge.

1
2
3
4
5
6
7
* {
	list-style-type: none;
	margin: 0;
	padding: 0;
	text-decoration: none;
	font-weight:normal;
}

Statistik: read: 3376 / today: 5 / last: 07.02.2012
//

  1. 9 Kommetare • Eintrag schreiben

  2. Bastian Winkler →
    #1 Permalink Am 13. May 2009 um 11:25 Uhr

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, font, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td {
    	margin: 0;
    	padding: 0;
    	border: 0;
    	outline: 0;
    	font-weight: inherit;
    	font-style: inherit;
    	font-size: 100%;
    	font-family: inherit;
    	vertical-align: baseline;
    	background-color: transparent;
    }
  3. David Hellmann →
    #2 Permalink Am 13. May 2009 um 11:29 Uhr

    Das ist dann wohl die etwas aufgebohrte variante :) Meistens reicht mir aber die kleine. Aber irgendwer wird sich auch an der umfangreichen erfreuen.

  4. Markus →
    #3 Permalink Am 13. May 2009 um 16:41 Uhr

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    @media screen, projection {
      html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;vertical-align:baseline;font-family:inherit;font-size:100%;font-style:inherit;font-weight:inherit;margin:0;padding:0}
    	html[xmlns^="http"]{overflow-y:scroll}
    	body{background-color:#fff}
    	:focus{outline:0}
    	ul,ol{list-style:none;list-style-type:none}
    	table{border-collapse:separate;border-spacing:0}
    	caption,th,td{text-align:left;font-weight:400}
    	blockquote:before,blockquote:after,q:before,q:after{content:""}
    	blockquote,q{quotes:"" ""}
    	a,a:link,a:visited,a:hover{text-decoration:underline;color:#000}
    	a:active,a:focus{outline:none}
    	sup{position:relative;bottom:0.3em;vertical-align:baseline}
    	sub{position:relative;bottom:-0.2em;vertical-align:baseline}
    	acronym,dfn,abbr{cursor:help;border-bottom:1px dashed}
    	del{text-decoration:line-through}
    	a abbr,a acronym{border:none}
    	cite,em,dfn,i{font-style:italic}
    	ins,dfn{border-bottom:1px solid #ccc}
    	code,kbd,samp,pre,tt,var{font-size:100%;font-family:monaco, "Lucida Console", courier, mono-space}
    	a img,img,img,iframe{border:none;text-decoration:none}
    }
  5. David Hellmann →
    #4 Permalink Am 13. May 2009 um 17:25 Uhr

    Ok dann ist das jetzt die super super aufgebohrte variante :)

  6. Marvin →
    #5 Permalink Am 13. May 2009 um 17:46 Uhr

    Ich benutze auch immer nur die minimale Variante, reicht eigentlich vollkommen aus.

  7. Markus →
    #6 Permalink Am 14. May 2009 um 16:47 Uhr

    hab mir meine reset.css im laufe der zeit zusammengestellt… man kann ja auch nur margin und padding per * auf 0 setzen… bis auf

    1
    
     html[xmlns^="http"]{overflow-y:scroll}

    ist alles valide

  8. Ohrflieger →
    #7 Permalink Am 23. May 2009 um 16:32 Uhr

    Mir reicht auch ein simples

    1
    2
    3
    4
    5
    
    * {
    margin:0;
    padding:0;
    border:0;
    }
  9. Ben →
    #8 Permalink Am 23. May 2009 um 21:31 Uhr

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    * {
        margin:0;
        padding:0;
        text-decoration:none;
        list-style:none;
        font-family:xxx;
        font-size:xx; 
        line-height:xx;
        font-weight: normal; }

    reicht mir eigentlich vollkommen. Font-family, font-size und font-weight lösche ich zum schluss. Mich regt das aber massig auf, wenn mir immer die Ultra-Monster Headlines beim formatieren im Weg um gehen.

  10. David Hellmann →
    #9 Permalink Am 23. May 2009 um 22:55 Uhr

    nanana, bei den den Font sachen könnte man aber die Kurzschreibweise anwenden > http://schnipsel.davidhellmann.com/css/css-font-kurzschreibweise/18 :)

Kommentar schreiben

Code einfügen: <pre lang="php" line="1"> Code hier </pre>