Tagged: CSS3

CSS Tutorial – Font Sizing

css3_logoYou can use Cascading Style Sheets (CSS) is to modify the font or typography of the page. There are several ways to describe font sizes.

In the font-size property, you’ll know that there are many different measurements to use when defining the size of the font.

Relative lengths

  • xx-small through xx-large – relative to the default browser font size
  • percentages – relative to the surrounding text
  • em and ex – relative to the parent element
  • pixels – relative to the screen resolution

Absolute lengths

  • points and picas – print units
  • inches, centimeters, and millimeters – length units

Continue reading

Snippet — Custom Fonts Fix

css3_logoFont embedding enables fonts used in the creation of a document to travel with that document, which ensures that a user views the document exactly as the author intended.

Modern browsers support the W3C standard for custom fonts, WOFF, at http://caniuse.com/#search=wof. WOFF is compressed TrueType/OpenType font that contains information about the font’s source. You can learn more about these at CSS3 Tutorial – Custom Fonts.

But what about earlier browsers?

Continue reading

HTML5 Tutorial – SVG Basic Shapes, Viewport, Path, Text, Fonts

image_thumb1SVG is a widely-deployed royalty-free graphics format developed and maintained by the W3C SVG Working Group. It is a language for describing 2D-graphics and graphical applications in XML.

You can find an overview of SVG in our previous post. In this section, you’ll learn about Basic Shapes, Path, Text, and Fonts.

With SVG, you can use XML and JavaScript to create web graphics that respond to user actions with sophisticated effects such as highlighting, tool tips, audio, and animation.

Continue reading

CSS3 Tutorial – Which Style Your Browser Chooses

css3_logoOne of the key features in using Cascading Style Sheets is that you set a style then override it. And you can override just part of the display or all of it. Knowing how a browser chooses and applies your styles is invaluable knowledge.

In the previous post, you learned how you could reset the browser settings. Those settings override the user agent to provide you with a consistent look to start from. The point is that you can override the styles.

Continue reading

HTML5, CSS3 Tip – Boilerplates

html5-boilerplateAs you have seen in our introductory posts on HTML5, you will want to start with some sort of boilerplate. Boilerplates help you remember all of the items you need to be successful.

HTML5Boilerplate helps you start your project with a lean, mobile-friendly HTML template; optimized Google Analytics snippet; placeholder touch-device icon; and docs covering dozens of extra tips and tricks.

Continue reading

CSS3 Tutorial – CSS Box Model

css3_logoEvery element in web design is a rectangular box. IN a previous post, Positioning & Inline, you learned about where the box is displayed. But that is only part of the story. The other part is about padding, border, and margin and how they affect where the box is displayed.

When you type in F12 in your favorite debugger, you will find tools that help you figure out the values in your style sheets for the size and location of the box.

Internet Explorer Chrome Firefox
image image image

But what happens when you do not declare your widths? What happens then?

This post relies on Chris Coyier’s excellent post The CSS Box Model.

Continue reading

CSS3 Tutorial – Positioning & Inline

css3_logoYou can do quite a bit with positioning. And until you understand positioning, you will just be hacking at your code.

I learned a lot from Learn CSS Positioning in Ten Steps. I owe him at least a beer. Check out his example that I have wholesale adopted.

There are three positioning schemes:

  • Normal flow. In CSS 2.1, normal flow includes block formatting of block-level boxes, inline formatting of inline-level boxes, and relative positioning of block-level and inline-level boxes.
  • Floats. In the float model, which is how we did the aside, a box is first laid out according to the normal flow, then taken out of the flow and shifted to the left or right as far as possible. Content may flow along the side of a float.
  • Absolute positioning. In the absolute positioning model, a box is removed from the normal flow entirely (it has no impact on later siblings) and assigned a position with respect to a containing block.

Continue reading

CSS3 Tutorial – Quick Introduction to Cascading Style Sheets (CSS)

css3_logoCascading Style Sheets (CSS) is a simple mechanism for adding style to Web documents, such as fonts, colors, spacing. HTML and CSS go together like peanut butter and jelly.

It is designed to separate content from formatting. This separation improves accessibility, provide more flexibility and control how your page looks, enables multiple pages to share the same formats, and reduce complexity and repetition in structural content.

CSS can allow the same page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice.

Continue reading