Is there a CSS reset for typography that can be applied to a specific class?

normalize css
css reset vs normalize
css reset alternative
myers css reset
list reset css
simple css reset
short css reset
table reset css

Is there a reliable CSS typography boilerplate, which works under a namespace (i.e., a class) and not globally?

Let me briefly explain the situation: I'm using a CSS reset for layout and I'd like to be able to add a certain class (.content for example) to a div, which would then apply some uniform typography rules to that div's elements only:

<p>This one's reset</p>
<div class="content">
    <p>This one has typography rules applied</p>
</div>

which would then apply some uniform typography rules to that div's elements only

If I understand correctly, you would just do this in your stylesheet, if you wanted to target every element in that div

div.content *{
    /* YOUR STYLES */     
}

If you want to style just the ps in that div then

div.content p{
    /* YOUR STYLES */     
}

Example: http://jsfiddle.net/8UE2D/

The Best CSS Reset Stylesheets, Using a CSS reset stylesheet can help make your HTML elements render consistently in It only resets the most frequently-used HTML elements — the ones you'll actually For example, it has specific style rules for the :before and :​after pseudo-classes and it sets the This is a baseline CSS reset just for Web typography. Unlike an ordinary CSS reset, I only target specific HTML tags’ styles rather than making a big list of tags. Here is an example of how to make your own CSS Reset : My CSS Reset— reset.local.css

You could use any pre-existing boiler plate. You'd just have to to a search and replace to to prepend .content to each selector in the file.

Opt-in Typography, The idea was that instead of setting global styles for typographic elements like p , ul , ol , h1 , h2 , etc that you would instead apply those styles as a class,  A CSS Reset (or “Reset CSS”) is a short, often compressed (minified) set of CSS rules that resets the styling of all HTML elements to a consistent baseline.. In case you didn’t know, every browser has its own default ‘user agent’ stylesheet, that it uses to make unstyled websites appear more legible.

So apparently, there is no such thing. And if you take a CSS typography boilerplate, you'll have to add a namespace yourself, which is an obvious solution, but not the one I was looking for.

My CSS Reset/Base, The second modification is that I moved the resetting of the font styles to another selector, as you'll see below. Typography. html { font-size: 62.5%  There are many other reset methods. But the problem with those reset methods is that, they are used to remove all the styling present in a web page (remove all the browser defaults for all elements and their properties), but if we want to remove the default only or some specific style for one element then the value unset comes in handy.

Sorry if this is late, but there is such a thing, see: http://www.gethifi.com/blog/a-boilerplate-for-css-typography

The demo is here: http://files.www.gethifi.com/blog/a-boilerplate-for-css-typography/demo/type.html

It's a CSS boilerplate which sets sizing, margins, and line-height (basically things to line up elements along a common baseline).

According to the site,

By default, all rules are preceeded with ".content". This is to make it easy to apply this stylesheet to a particular container.

I haven't used it but did confirm that the typography.css file has the rules prepended with .content.

What Is A CSS Reset?, give tables a certain amount of border and padding, apply variable font-sizes to H1, H2, Using a CSS Reset, CSS authors can force every browser to have all its Some people claim that this is unnecessary – that there's no sense resetting an advanced(12); layout(10); :hover(10); position(10); color(9); typography(7). Reboot, a collection of element-specific CSS changes in a single file, kickstart Bootstrap to provide an elegant, consistent, and simple baseline to build upon. If you’re new to CSS development, the whole idea of a CSS reset is to deal with styling inconsistencies across browsers.

Font Squirrel will generate well tested @font-face syntax for you, and Paul Irish has the Bulletproof @font-face technique explanation so you can understand the thought process behind Font Squirrel.

Font Squirrel will end up giving you CSS similar to this:

@font-face { 
    font-family: 'MyWebFont'; 
    src: url('WebFont.eot'); 
    src: url('WebFont.eot?#iefix') format('embedded-opentype'), 
    url('WebFont.woff') format('woff'), 
    url('WebFont.ttf') format('truetype'), 
    url('WebFont.svg#webfont') format('svg'); 
}

Which you can include in your style sheet and then reference with a .content class like this:

.content { 
    font-family: 'WebFont', Arial, sans-serif; 
}

Working with Typography - Learn to Code HTML & CSS, In the past we were limited to a small number of typefaces that we could use on a website. on a given device, the next font in the list—Helvetica—will be used, and so on. The following CSS sets all elements with a class of special to include a these custom styles, placing it just below our reset and above our grid styles. There were a couple of surprising bits in there, one of which was about “opt-in typography.” The idea was that instead of setting global styles for typographic elements like p, ul, ol, h1, h2, etc that you would instead apply those styles as a class, perhaps .text.

Normalize CSS or CSS Reset?! - Elad Shechter, has its specific styles different from other browsers, and that, of course, In these cases the fixes in the Normalize will apply the IE or EDGE styles to the Unlike an ordinary CSS reset , I only target specific HTML tags' styles rather CSS or CSS reset, it's a basic style sheet with the website's typography,  Learning how to code HTML & CSS and building successful websites can be challenging, and at times additional help and explanation can go a long way. Fortunately there are plenty of online schools, boot camps, workshops, and the alike, that can help.

Complete Bootstrap: Responsive Web Development with Bootstrap 4: , Now that we've reviewed the Reboot CSS reset, it's time to actually start In Bootstrap 4, there are no major changes with the core typographic HTML tags. However, there are some new utility classes you can use with some type tags to class="display-4">Display 4</h1>Keep in mind you can apply these classes to any  There is a property called all that is being proposed for resetting all CSS properties for a given element to certain CSS-wide values - the value you want to use would be unset, which resets a property to either its inherited value if it inherits by default, or otherwise, its initial value. No word on implementation, but it's nice to know

Bootstrap 4 – Responsive Web Design, Now that we've reviewed the Reboot CSS reset, it's time to actually start In Bootstrap 4, there are no major changes with the core typographic HTML tags. class="display-4">Display 4</h1> Keep in mind you can apply these classes. To select elements with a specific class, write a period (.) character, followed by the name of the class. You can also specify that only specific HTML elements should be affected by a class. To do this, start with the element name, then write the period (.) character, followed by the name of the class (look at Example 1 below). HTML elements

Comments
  • What exactly are "typography rules"?
  • This is the basics of css, add a class in front of your reset css and now it is namespaced. If you don't have a css preprocessor (which would make this very easy) then you will need to do some work to add the classes
  • Good idea! You can even write .content * {...} without the div, so it works for all elements of and within this class.