LegaCSS is a simple baseplate, designed to give you basic styles that most websites and browsers can understand, so you don't waste time rebuilding buttons, boxes, and layout basics from zero.

We have a different philosophy: being responsive is not the same as being compatible. A site can adapt to screen sizes and still leave older browsers behind. LegaCSS is built to do both at once, that's why we created this framework.

LegaCSS is browser friendly, it even works on IE 6, yes, IE 6. We believe in connectivity for everyone, and we don't want to limit people from visiting webpages just because their browser is outdated. There's usually a reason why it's outdated, and that's not our problem to fix, but we won't lock those users out either :)

ALERT: LegaCSS doesn't include ready-made Nav, Footer, or Main components, only basic building blocks (typography, buttons, grid, forms). You still need to design and build your own navigation, footer, and page structure on top of it.

<html> Works on HTML

<!--[if lt IE 7]>   <html class="ie ie6 lt-ie9 lt-ie8 lt-ie7">  <![endif]-->

<!--[if lt IE 8]>   <html class="ie ie7 lt-ie9 lt-ie8"> <![endif]-->

<!--[if lt IE 9]>   <html class="ie ie8 lt-ie9">    <![endif]-->

<!--[if IE 9]>  <html class="ie ie9">   <![endif]-->

<!--[if (gt IE 9)|!(IE)]><!-->

<html class="no-ie ieEdge">

<!--<![endif]-->

<body> Works on HTML & XHTML

<!--[if lt IE 7]>   <body class="ie ie6 lt-ie9 lt-ie8 lt-ie7">  <![endif]-->

<!--[if lt IE 8]>   <body class="ie ie7 lt-ie9 lt-ie8"> <![endif]-->

<!--[if lt IE 9]>   <body class="ie ie8 lt-ie9">    <![endif]-->

<!--[if IE 9]>  <body class="ie ie9">   <![endif]-->

<!--[if (gt IE 9)|!(IE)]><!-->

<body class="no-ie ieEdge">

<!--<![endif]-->

Before Starting

Remember to include Paul Irish's conditionals for Internet Explorer before you begin. This not only ensures that our framework works correctly in these browsers, but it also provides a simple way for framework users to create fallbacks easily.

Where conditional tags should be placed depends on the technology being used. In the case of HTML (HTML 4.01, HTML 5), the tags can be placed either in the <html> or in <body>. However, in the case of XHTML (XHTML 1.0, XHTML 5), they can only be placed in the <body> because the <html> serves a different purpose.


Note: Even if the baseplate works in Internet Explorer, that doesn't mean that all styles (modifiers) will work in Internet Explorer.

Example

Any Browser and IE 9
Example
Internet Explorer IE 6 - 8
Example

Download Options

Select the version you want to download


Download
Get complete version

Or get parted version


Reset General Grid Forms


Supported Browsers
Browser Desktop Mobile
Internet Explorer 6+ 9+
Firefox 3.6+
Opera 11.1+ 12+
Konqueror 4+
Safari 4+ 3.1+
Chrome 4+ 46+
Android Browser 2.1+

Typography

h1, h2, h3, h4, h5, h6, b, i, strong, em, small, p

By default, the text is set to use the Arial, Helvetica, and sans-serif fonts at a base size of 12px (and 14px for resolutions lower than 620px like mobile phones), using EM units to allow the font size to be adjusted based on the device without the need for REM. This ensures that the website functions properly in all browsers.

The text includes the classic HTML tags: <b> and <strong> for bold text, <i> and <em> for italic text, and we've brought back the classic <u> tag for underlined text.

There are ways to modify the text of headings and paragraphs. For headings, you can use .subheading to display the heading text without bold formatting, while if you use <small>, the text will appear 60% smaller and in gray ideal for slogans or notes.

For paragraphs, if you use <small>, the text will appear 60% smaller ideal for short notes.

There are tags for highlighting text, using .highlight-[color]


These are the types of highlights:

.highlight-clear

.highlight-red

.highlight-green

.highlight-blue

.highlight-yellow


In addition, there are selectors for aligning text using align-[direction]


These are the directions of align:

.align-left

.align-right

.align-center


Note: you also can use <center> to align items to center


Tags

<h1> - Heading 1

<h2> - Heading 2

<h3> - Heading 3

<h4> - Heading 4

<h5> - Heading 5
<h6> - Heading 6

<p> - Paragraph

Tags Variations

Heading

Subheading

<small> Heading


Paragraph

<small> Paragraph

Tables

Example Table:

<th>
<td> <td> <td>
<th> <td> <td>

Table <thead> Elements:

<th>
<td>

Table <tbody> Elements:

<th> <td>

Code:

<table>

  <thead>

      <tr>

          <th colspan="3">&lt;th&gt;</th>

      </tr>

      <tr>

          <td>&lt;td&gt;</td>

          <td>&lt;td&gt;</td>

          <td>&lt;td&gt;</td>

      </tr>

  </thead>

  <tbody>

      <tr>

          <th>&lt;th&gt;</th>

          <td>&lt;td&gt;</td>

          <td>&lt;td&gt;</td>

      </tr>

  </tbody>

</table>

Lists

List:

<ul>


  • <li>
  • <li>
  • <li>
  • <li>
  • <li>

List Square:

<ul class="list--square">


  • <li>
  • <li>
  • <li>
  • <li>
  • <li>

List Circle:

<ul class="list--circle">


  • <li>
  • <li>
  • <li>
  • <li>
  • <li>

List disc:

<ul class="list--disc">


  • <li>
  • <li>
  • <li>
  • <li>
  • <li>

Ordered List:

<ol>


  1. <li>
  2. <li>
  3. <li>
  4. <li>
  5. <li>

IMPORTANT

CSS Classes rules

The CSS system is very specific when it comes to assigning classes. CSS follows this system:

<div class="[class] [class--modifyer] [class--modifyer-#]">

Example 1:

This is a an example 10px padding box with

Example 2:

Example 1:

<div class="box box--p-10">

    <p>This is a an example 10px padding box with</p>

</div>

Example 2:

<div class="box box--p-10">

    <p><a style="margin: 0;" href="" class="btn btn--regular btn--default btn--outline btn--radius btn--nice btn--red">Example</a></p>

</div>

Grid System

Container, Wrap

We use a special layout system... to avoid any legal disputes with other frameworks. We drew inspiration from the naming conventions of the old IUSACELL website, and its behavior is based on how ZURB Foundation 2.x and Twitter Bootstrap 1.x work.

That's why we use the .container class for the outer block and .wrap for the inner block. This means that .container defines the outer space, and .wrap defines the inner space.

Classes:

.container This causes the element to be displayed as block in its entirety on the page, with 12px of padding on each side.
.wrap This goes inside .container and creates a 900px centered area, which adjusts based on the screen size.
.warp-fluid This goes inside .container and creates a 100% area, which adjusts based on the screen size.

Modifyers: remember to add the class ".container"

.container--ext Set .wrap to stretch up to 1000px
.container--ext-plus Set .wrap to stretch up to 1400px and change the side padding from 12px to 24px (for resolutions less than 922px, the padding remains 12px)

Container:

<div class="container">

    <div class="wrap">

    </div>

</div>

Container Extended:

<div class="container container--ext">

    <div class="wrap">

    </div>

</div>

Container Extended Plus:

<div class="container container--ext-plus">

    <div class="wrap">

    </div>

</div>

Row, Column

Rows

.row Defines the container for the table (applys ClearFix)
.row .row--spaced Defines the container for the table (applys ClearFix)

Columns

.col Define the styles for the column system.
.col .col--w-100 Define the size for the column to 100%.
.col .col--w-90 Define the size for the column to 90%.
.col .col--w-85 Define the size for the column to 85%.
.col .col--w-80 Define the size for the column to 80%.
.col .col--w-75 Define the size for the column to 75%.
.col .col--w-66 Define the size for the column to 66%.
.col .col--w-50 Define the size for the column to 50%.
.col .col--w-33 Define the size for the column to 33%.
.col .col--w-25 Define the size for the column to 25%.
.col .col--w-20 Define the size for the column to 20%.
.col .col--w-15 Define the size for the column to 15%.
.col .col--w-10 Define the size for the column to 10%.

Row and Col:

<div class="row">

    <div class="col col--w-100">

    </div>

</div>

Row Spaced and Col:

<div class="row row--spaced">

    <div class="col col--w-100">

    </div>

</div>

Example:

100%
90%
85%
80%
75%
66%
50%
33%
25%
20%
15%
10%

Elements


Boxes

.box, .box--p-[size]

The .box class simply resets floats (zoom: 1) and gives you a block-level element to pad. Padding is added through the .box--p-[size] modifiers, from 2 to 20 pixels, so you never need a custom inline style just to add spacing.

.box--p-22px padding
.box--p-44px padding
.box--p-66px padding
.box--p-88px padding
.box--p-1010px padding
.box--p-1212px padding
.box--p-1414px padding
.box--p-1616px padding
.box--p-1818px padding
.box--p-2020px padding

Example:

<div class="box box--p-10">

    content

</div>

This box uses .box--p-20

Blocks

.block, .block--outline, .block--border-classic, .block--radius, .block--[color], .block--txt-[color], .block--nice

A .block is a full-width, self-clearing container (it applies ClearFix automatically) meant to wrap a colored panel, alert, or callout. Combine it with .box--p-[size] for the inner padding, same as you saw in the alert on the Welcome section.

Border Style:

.block--outlineAdds a 1px solid border (negative margin keeps widths aligned)
.block--border-classicAdds an old-school 2px outset (beveled) border, Win95/98 style
.block--radius4px rounded corners on the block, and on its .b-heading/.b-content if present (see "Block Headings" below)

Color:

.block--clearLight gray background
.block--darkDark background, use with .block--txt-clear or .block--txt-white for the text
.block--classicFlat Win95/98-gray background
.block--classic-y2kFlat Win2000/XP-beige background
.block--redRed background
.block--greenGreen background
.block--blueBlue background
.block--yellowYellow background

Text Color:

.block--txt-darkDark gray text, for light backgrounds
.block--txt-clearMuted gray text, for dark backgrounds
.block--txt-blackSolid black text
.block--txt-whiteSolid white text

Effect:

.block--niceAdds a subtle top-to-bottom gloss gradient to the block (falls back to flat color on old IE, see .lt-ie9 .block--nice). If the block has a .b-heading, .block--nice glosses the heading too

Note: always pair a color modifier with a matching text-color modifier (e.g. .block--dark + .block--txt-clear) so the text stays readable.

Examples:

.block--outline .block--clear
.block--outline .block--dark
.block--border-classic .block--classic
.block--border-classic .block--classic-y2k
.block--outline .block--red
.block--outline .block--green
.block--outline .block--blue
.block--outline .block--yellow
.block--outline .block--radius .block--red .block--nice .block--txt-white

Block Headings

.b-heading, .b-content, .b-heading--[color], .b-heading--nice

Updated in V2.0: a titled panel is now built from two siblings inside .block, not one nested div — .b-heading for the title bar and .b-content for the body. When the block has .block--outline or .block--border-classic, both the heading and the content get their own matching border automatically (heading: full border; content: border-top only, so they read as one continuous panel). Add .block--radius to the block to round the heading's top corners and the content's bottom corners.

.b-heading--blackBlack heading, white text
.b-heading--whiteLight gray heading, dark text
.b-heading--classicWindows 95/98 title-bar look: flat navy blue, white text
.b-heading--classic-2kWindows XP "Luna" title-bar look: blue gradient, white text
.b-heading--redRed heading, white text
.b-heading--greenGreen heading, white text
.b-heading--blueBlue heading, white text
.b-heading--l-blueLight blue heading, white text
.b-heading--yellowYellow heading, dark text

Note: .b-heading--nice (or .block--nice on the parent) adds the gloss effect to the title bar only; the .b-content stays flat.

Code:

<div class="block block--outline block--radius">

    <div class="b-heading b-heading--blue">Title</div>

    <div class="b-content">Body</div>

</div>

Example:

Panel Title
Panel body content goes here.
Title
.block--outline .b-heading--blue here.
Sucess
.b-heading--green .b-heading--nice body.
Error
.block--nice .b-heading--red body.
Warning
.block--radius .b-heading--yellow body.
Windows 95/98 Style
.b-heading--classic body.
Windows ME/2000 Style
.b-heading--classic-y2k body.

Global Helpers

.left, .right, .hide, .hide-[breakpoint], .hide-ie[6-9]

A handful of no-frills utility classes are always available, independent of the grid or the button/block systems:

.leftfloat: left
.rightfloat: right
.hidedisplay: none, always
.hide-lt-600 / .hide-lt-700Hides an element only under 600px / 700px width
.hide-700 / .hide-900 / .hide-1000 / .hide-1400Hides an element only above the matching breakpoint
.hide-ie6 / .hide-ie7 / .hide-ie8 / .hide-ie9Hides an element only in that version of Internet Explorer (needs the <html>/<body> IE conditional classes from "Before Starting")

Example:

<div class="hide-ie6 hide-ie7">

    Hidden on IE6 and IE7 only

</div>

Buttons

.btn, .btn--[size], .btn--[position], .btn--[border], .btn--[shape], .btn--nice, .btn--[color]

Any <a> (or other inline element) becomes a button once you add .btn. From there you stack modifiers for size, position, border, corner shape, gloss effect and color — same "class + class--modifyer" system used everywhere else in LegaCSS.

Size:

.btn--tinySmaller text and padding
.btn--regularDefault size
.btn--hugeLarger text and padding, good for calls-to-action

Position:

.btn--leftfloat: left
.btn--rightfloat: right
.btn--defaultNo float, clears both sides
.btn--default-fullBlock-level, 100% width, no side padding

Border:

.btn--outline1px solid border
.btn--border-classic2px outset border, inset when :active (classic pressed-button feel)

Shape:

.btn--radius4px rounded corners
.btn--round20px rounded (pill-shaped) corners

Effect:

.btn--niceSubtle top-lit gloss gradient, inverts on :active for a pressed look (skipped on old IE)

Color:

.btn--black / .btn--whiteBlack or off-white/gray button
.btn--classic / .btn--classic-2kWin95/98-gray or Win2000/XP-beige button
.btn--red / .btn--green / .btn--blue / .btn--l-blue / .btn--yellowSolid color buttons, each with a matching :hover shade

Examples:

.btn--tiny .btn--regular .btn--huge

.btn--left .btn--right .btn--default .btn--default-full

.btn--blue .btn--green .btn--red

.btn--yellow .btn--black .btn--white

.btn--classic .btn--classic-y2k

.btn--outline .btn--white .btn--border-classic .btn--classic .btn--border-classic .btn--classic-y2k

.btn--red .btn--nice .btn--red .btn--radius .btn--red .btn--round

Code:

<a class="btn btn--regular btn--outline btn--radius btn--nice btn--blue">

    Example

</a>

Button Groups:

Wrap a set of buttons in .btn-gp to merge their borders into a single strip. Add .btn-gp--radius or .btn-gp--round so only the first and last buttons keep rounded outer corners — mark them with the .first-child / .last-child classes for old IE, since :first-child/:last-child aren't reliable there.

One Two Three

Forms


Text Inputs

.txt-input, .txt--[size], .txt--[shape], .txt--nice

Add .txt-input to any <input> or <textarea> for a classic inset field (2px inset border, darkens slightly on :focus). Same size and shape modifiers as buttons apply.

.txt--tiny / .txt--regular / .txt--hugeField size
.txt--radius / .txt--roundRounded corners
.txt--niceAdds a light 1px border with an inset shadow for extra depth

Example:

.txt-input .txt--tiny

.txt-input .txt--regular

.txt-input .txt--huge

.txt-input .txt--regular .txt--nice

.txt-input .txt--regular .txt--radius

.txt-input .txt--round .txt--radius

<input type="text" class="txt-input txt--regular txt--radius txt--nice" />

Guides


Building a page from scratch

LegaCSS deliberately skips nav bars, footers, and any JavaScript, so putting a page together is mostly about picking the right containers and reusing the class + modifier system consistently.

  1. Add the IE conditional classes to <html> or <body> (see "Before Starting" above) so the .ie6.ie9 and .hide-ie[6-9] hooks work.
  2. Wrap each section of the page in .container, and put a .wrap inside it to center your content at 900px (or use .container--ext / .container--ext-plus for wider layouts).
  3. Lay out content with .row / .row--spaced and .col--w-[percentage] columns.
  4. Use .box--p-[size] for padding and .block / .block--[color] for callouts and panels.
  5. Style your own nav, footer, and interactive bits by hand, on top of the typography, buttons, and form classes LegaCSS already gives you.
Reminder: LegaCSS only resets and styles the basics — nav, footer, and main layout structure are intentionally left for you to design.