SlideShare a Scribd company logo
CSS
GLOBAL RESETS
What is
CSS reset?
All browsers have a
default style sheet.
The problem is that these default
style sheets are different in each
            browser.
CSS resets aim to remove all
browser-specific styles, and then
build CSS up again from scratch -
 so that each element will appear
     the same in all browsers.
The simplest reset involves
    removing the margin and padding
      from all elements using the
          universal selector.

*
{
      margin: 0;
      padding: 0;
}
However, this reset can
 adversely affect some form
elements that should not have
  their margins and padding
          removed.
More advanced CSS resets aim
to reset almost every aspect of
         every element:
    • Set margins and padding to zero
           • Set borders to zero
        • Remove visual list styles
           • Set fonts to a base
• Set font-weight and font-style to normal
Two of the most widely used
        CSS resets are:
             Eric Meyer Reset
http://meyerweb.com/eric/thoughts/2007/05/0
             1/reset-reloaded/

             YUI 2: Reset CSS
   http://developer.yahoo.com/yui/reset/
Are CSS resets
 a good idea?
Some people love CSS resets,
and others hate them. There is no
 right or wrong, only opinions!
I have three main concerns
      with CSS resets
Every element that is “zeroed”
must then be redefined. This can
 cause an increase in CSS file
             size.
CSS Resets can present issues if
you remove the default behaviour
for an element and then forget to
           restyle it.
Some resets can be harmful to
  users who rely on keyboards for
           navigation.



:focus {outline: 0;}
A lighter CSS reset
      example
I prefer to use a smaller set of
CSS rules that mean that only
   common or problematic
      elements are reset.
1. Remove margin and padding
    on some key elements only


html, body, ul, ol, li, form,
fieldset, legend
{
    margin: 0;
    padding: 0;
}
2. Remove top margins on
    headings and paragraphs


h1, h2, h3, h4, h5, h6, p
{
    margin-top: 0;
}
3. Remove fieldset and image
            borders


fieldset, img
{
    border: 0;
}
4. Set table borders and
              spacing


table
{
    border-collapse: collapse;
    border-spacing: 0;
}
5. Set caption, table header and
          table data cells


caption, th, td
{
    text-align: left;
    vertical-align: top;
    font-weight: normal;
}
6. Apply color to fieldset
   (to overcome IE color issues)


legend
{
    color: #000;
}
7. Apply font-size and line-height
   to input, textarea and select


input, textarea, select
{
    font-size: 110%;
    line-height: 1.1;
}
8. Remove list bullets



li
{
     list-style: none;
}
9. Apply border-bottom and
   cursor to abbr and acroynm


abbr, acronym
{
    border-bottom: .1em dotted;
    cursor: help;
}
10. Vertical-align sup and sub to
         avoid line-height issues


sup
{
      vertical-align: text-top;
}
sub
{
      vertical-align: text-bottom;
}

More Related Content

PPT
Css best practices style guide and tips
PDF
CSS Best practice
PDF
Efficient, maintainable CSS
PDF
CSS3 Media Queries
ODP
Cascading Style Sheets - Part 02
PDF
SMACSS Workshop
PDF
CSS Systems
Css best practices style guide and tips
CSS Best practice
Efficient, maintainable CSS
CSS3 Media Queries
Cascading Style Sheets - Part 02
SMACSS Workshop
CSS Systems

What's hot (20)

PDF
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
PDF
CSS: a rapidly changing world
PDF
Introduction to CSS3
PDF
Maintainable CSS
PDF
CSS3 Introduction
PDF
CSS pattern libraries
PDF
CSS - OOCSS, SMACSS and more
PDF
Fundamental CSS3
PPTX
Basics of Front End Web Dev PowerPoint
PDF
PPTX
About Best friends - HTML, CSS and JS
PPTX
Introduction to HTML and CSS
PPTX
Bootstrap Framework
PPTX
Bootstrap webtech presentation - new
PDF
Intro to CSS3
PDF
Modular HTML, CSS, & JS Workshop
PPTX
Presentation about html5 css3
PPTX
Css3 Presetation
PDF
[Worskhop Summits] CSS3 Workshop
PPTX
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
CSS: a rapidly changing world
Introduction to CSS3
Maintainable CSS
CSS3 Introduction
CSS pattern libraries
CSS - OOCSS, SMACSS and more
Fundamental CSS3
Basics of Front End Web Dev PowerPoint
About Best friends - HTML, CSS and JS
Introduction to HTML and CSS
Bootstrap Framework
Bootstrap webtech presentation - new
Intro to CSS3
Modular HTML, CSS, & JS Workshop
Presentation about html5 css3
Css3 Presetation
[Worskhop Summits] CSS3 Workshop
Ad

Viewers also liked (8)

PDF
TIAD - DYI: A simple orchestrator built step by step
PPT
SASS + COMPASS - Alta Produtividade no Front-end
PDF
Three quick accessibility tips for HTML5
PDF
Responsive Web Design - more than just a buzzword
PDF
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
PDF
Best Practices in Web Service Design
PDF
VerA\UX – Ausstellungsdesign und Social Media
PDF
Gesellschaft und Informatik – Vom Verstand zum Algorithmus
TIAD - DYI: A simple orchestrator built step by step
SASS + COMPASS - Alta Produtividade no Front-end
Three quick accessibility tips for HTML5
Responsive Web Design - more than just a buzzword
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Best Practices in Web Service Design
VerA\UX – Ausstellungsdesign und Social Media
Gesellschaft und Informatik – Vom Verstand zum Algorithmus
Ad

Similar to CSS Reset (20)

PPTX
Web topic 16 css workflow
PDF
Advanced CSS Troubleshooting & Efficiency
KEY
CSS Frameworks
PDF
Advanced CSS Troubleshooting
PPTX
Super Stylesheets
PPTX
Super stylesheets download_en
PPT
Advance Css 1194323118268797 5
PPT
Advance Css
DOCX
Project 2index.html__MACOSXProject 2._index.htmlProje.docx
KEY
Css Essential
PDF
CSS Frameworks: Make the Right Choice (EOTW09)
PDF
Roadmap 01
KEY
Simplifying CSS With Sass
KEY
Messy css
PDF
Yuicss R7
PDF
CSS Frameworks: Make the Right Choice (WDS09)
PPTX
Week 3
DOCX
destyleindex.html__MACOSXdestyle._index.htmldestyle..docx
KEY
Demystifying CSS & WordPress
PPT
Stylesheets for Online Help - Scott DeLoach, ClickStart
Web topic 16 css workflow
Advanced CSS Troubleshooting & Efficiency
CSS Frameworks
Advanced CSS Troubleshooting
Super Stylesheets
Super stylesheets download_en
Advance Css 1194323118268797 5
Advance Css
Project 2index.html__MACOSXProject 2._index.htmlProje.docx
Css Essential
CSS Frameworks: Make the Right Choice (EOTW09)
Roadmap 01
Simplifying CSS With Sass
Messy css
Yuicss R7
CSS Frameworks: Make the Right Choice (WDS09)
Week 3
destyleindex.html__MACOSXdestyle._index.htmldestyle..docx
Demystifying CSS & WordPress
Stylesheets for Online Help - Scott DeLoach, ClickStart

More from Russ Weakley (20)

PDF
Accessible chat windows
PDF
Accessible names & descriptions
PDF
A deep dive into accessible names
PDF
What are accessible names and why should you care?
PDF
How to build accessible UI components
PDF
What is WCAG 2 and why should we care?
PDF
Accessible states in Design Systems
PDF
Creating accessible modals and autocompletes
PDF
Building an accessible progressive loader
PDF
Accessibility in Design systems - the pain and glory
PDF
Accessible Inline errors messages
PDF
Accessible Form Hints and Errors
PDF
What is accessibility?
PDF
Accessibility in Pattern Libraries
PDF
Accessibility in pattern libraries
PDF
Building an accessible auto-complete - #ID24
PDF
Building an accessible auto-complete
PDF
Creating Acessible floating labels
PDF
Creating an Accessible button dropdown
PDF
Creating a Simple, Accessible On/Off Switch
Accessible chat windows
Accessible names & descriptions
A deep dive into accessible names
What are accessible names and why should you care?
How to build accessible UI components
What is WCAG 2 and why should we care?
Accessible states in Design Systems
Creating accessible modals and autocompletes
Building an accessible progressive loader
Accessibility in Design systems - the pain and glory
Accessible Inline errors messages
Accessible Form Hints and Errors
What is accessibility?
Accessibility in Pattern Libraries
Accessibility in pattern libraries
Building an accessible auto-complete - #ID24
Building an accessible auto-complete
Creating Acessible floating labels
Creating an Accessible button dropdown
Creating a Simple, Accessible On/Off Switch

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Understanding_Digital_Forensics_Presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...

CSS Reset

  • 3. All browsers have a default style sheet.
  • 4. The problem is that these default style sheets are different in each browser.
  • 5. CSS resets aim to remove all browser-specific styles, and then build CSS up again from scratch - so that each element will appear the same in all browsers.
  • 6. The simplest reset involves removing the margin and padding from all elements using the universal selector. * { margin: 0; padding: 0; }
  • 7. However, this reset can adversely affect some form elements that should not have their margins and padding removed.
  • 8. More advanced CSS resets aim to reset almost every aspect of every element: • Set margins and padding to zero • Set borders to zero • Remove visual list styles • Set fonts to a base • Set font-weight and font-style to normal
  • 9. Two of the most widely used CSS resets are: Eric Meyer Reset http://meyerweb.com/eric/thoughts/2007/05/0 1/reset-reloaded/ YUI 2: Reset CSS http://developer.yahoo.com/yui/reset/
  • 10. Are CSS resets a good idea?
  • 11. Some people love CSS resets, and others hate them. There is no right or wrong, only opinions!
  • 12. I have three main concerns with CSS resets
  • 13. Every element that is “zeroed” must then be redefined. This can cause an increase in CSS file size.
  • 14. CSS Resets can present issues if you remove the default behaviour for an element and then forget to restyle it.
  • 15. Some resets can be harmful to users who rely on keyboards for navigation. :focus {outline: 0;}
  • 16. A lighter CSS reset example
  • 17. I prefer to use a smaller set of CSS rules that mean that only common or problematic elements are reset.
  • 18. 1. Remove margin and padding on some key elements only html, body, ul, ol, li, form, fieldset, legend { margin: 0; padding: 0; }
  • 19. 2. Remove top margins on headings and paragraphs h1, h2, h3, h4, h5, h6, p { margin-top: 0; }
  • 20. 3. Remove fieldset and image borders fieldset, img { border: 0; }
  • 21. 4. Set table borders and spacing table { border-collapse: collapse; border-spacing: 0; }
  • 22. 5. Set caption, table header and table data cells caption, th, td { text-align: left; vertical-align: top; font-weight: normal; }
  • 23. 6. Apply color to fieldset (to overcome IE color issues) legend { color: #000; }
  • 24. 7. Apply font-size and line-height to input, textarea and select input, textarea, select { font-size: 110%; line-height: 1.1; }
  • 25. 8. Remove list bullets li { list-style: none; }
  • 26. 9. Apply border-bottom and cursor to abbr and acroynm abbr, acronym { border-bottom: .1em dotted; cursor: help; }
  • 27. 10. Vertical-align sup and sub to avoid line-height issues sup { vertical-align: text-top; } sub { vertical-align: text-bottom; }