Tag Archive for css

background-image para las filas de una tabla

/*
Don't do it the intuitive way...
*/
<table>
<tr style="background: url(/images/tr-background.gif) no-repeat 0 0;">
<td>Row 1</td>
<td>Row 2</td>
<td>Row 3</td>
</tr>
</table>

/*
...because it doesn't work in IE6 or Safari, even if you set
the <td> background element to 'transparent' or 'none'.
But you can still make it happen with just the one image:
*/

<table>
<tr>
<td style="background: url(/images/tr-background.gif) no-repeat 0 0;">Row 1</td>
<td style="background: url(/images/tr-background.gif) no-repeat 50% 0;">Row 2</td>
<td style="background: url(/images/tr-background.gif) no-repeat 100% 0;">Row 3</td>
</tr>
</table>

/*
You're just altering the background-position of the image, so that
what should be on the left goes on the left (at 0), the middle
part goes to the middle (50% horizontally), and the last part goes
at the end (100%). Remember that values in the background-position
element are ordered horizontal, then vertical, unlike the margin
and padding elements.

And, of course, you'll want to separate presentation from content
by putting the CSS elsewhere and classing the td's.
*/

source

CSS Layout Starting Points (by Rachel Andrew)

// ==========
// = HTML =
// ==========

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fixed Width and Centred starting point document</title>
<link rel="stylesheet" type="text/css" href="fixed-width-centred.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="wrapper">
<div id="side">
<div class="inner">
<p>Sidebar content here</p>
</div>
</div>
<div id="content">
<div class="inner">
<p>Your main content goes here.</p>
</div>
</div>
<div id="footer">
<div class="inner">
<p>Ho Ho Ho!</p>
</div>
</div>
</div>
</body>
</html>

// ==========
// = CSS =
// ==========

body {
text-align: center;
min-width: 740px;
padding: 0;
margin: 0;
}

#wrapper {
text-align: left;
width: 740px;
margin-left: auto;
margin-right: auto;
padding: 0;
}

#content {
margin: 0 200px 0 0;
}

#content .inner {
padding-top: 1px;
margin: 0 10px 10px 10px;
}

#side {
float: right;
width: 180px;
margin: 0;
}

#side .inner {
padding-top: 1px;
margin: 0 10px 10px 10px;
}

#footer {
margin-top: 10px;
clear: both;
}

#footer .inner {
margin: 10px;
}

source

wrap your livebookmarks

#bookmarksBarContent { display: block !important; overflow: visible;}
#bookmarksBarContent toolbarseparator { display: inline !important; }
#bookmarksBarContent .bookmark-item { visibility: visible !important; }

.places-toolbar-items { display: block !important; height: 33px !important; overflow-y: auto !important; }
.chevron { display: none !important; }

source

CSS Drop Shadow

****************
***** CSS ******
****************

.dropShadow {
position:relative;
z-index:1;
}

/*border boxes; inside-->outside*/
.dropShadow .drop1, .dropShadow .drop2, .dropShadow .drop3,
.dropShadow .drop4, .dropShadow .drop5 {
position:absolute;
right:0;
bottom:0;
width:100%;
height:100%;
}
.dropShadow .drop1 { opacity:0.5; }
.dropShadow .drop2 { opacity:0.4; }
.dropShadow .drop3 { opacity:0.3; }
.dropShadow .drop4 { opacity:0.2; }
.dropShadow .drop5 { opacity:0.1; }

.dropShadow.dropBR .drop1, .dropShadow.dropBR .drop2, .dropShadow.dropBR .drop3,
.dropShadow.dropBR .drop4, .dropShadow.dropBR .drop5 {
top:0; left:0;			/*shadow positioned bottom-right*/
}
.dropShadow.dropBL .drop1, .dropShadow.dropBL .drop2, .dropShadow.dropBL .drop3,
.dropShadow.dropBL .drop4, .dropShadow.dropBL .drop5 {
top:0; left:-16px;		/*shadow positioned bottom-left*/
}
.dropShadow.dropTR .drop1, .dropShadow.dropTR .drop2, .dropShadow.dropTR .drop3,
.dropShadow.dropTR .drop4, .dropShadow.dropTR .drop5 {
top:-16px; left:0;		/*shadow positioned top-right*/
}
.dropShadow.dropTL .drop1, .dropShadow.dropTL .drop2, .dropShadow.dropTL .drop3,
.dropShadow.dropTL .drop4, .dropShadow.dropTL .drop5 {
top:-16px; left:-16px;	/*shadow positioned top-left*/
}

/*top & bottom borders*/
.dropShadow .drop1 div, .dropShadow .drop2 div, .dropShadow .drop3 div,
.dropShadow .drop4 div, .dropShadow .drop5 div {
position:absolute;
top:8px; right:0; bottom:0; left:8px;
border-style:solid;
border-color:#999999;
}
.dropShadow .drop1 div { margin:7px -1px -1px 7px; border-width:1px 0 1px 0; background-color:#999999; }
.dropShadow .drop2 div { margin:6px -2px -2px 6px; border-width:1px 0 1px 0; }
.dropShadow .drop3 div { margin:4px -4px -4px 4px; border-width:2px 0 2px 0; }
.dropShadow .drop4 div { margin:2px -6px -6px 2px; border-width:2px 0 2px 0; }
.dropShadow .drop5 div { margin:0 -8px -8px 0; border-width:2px 0 2px 0; }

/*left & right borders*/
.dropShadow .drop1 div div, .dropShadow .drop2 div div, .dropShadow .drop3 div div,
.dropShadow .drop4 div div, .dropShadow .drop5 div div {
position:absolute;
top:0; right:0; bottom:0; left:0;
margin:0;
}
.dropShadow .drop1 div div { border-width:0 1px 0 1px; }
.dropShadow .drop2 div div { border-width:0 1px 0 1px; }
.dropShadow .drop3 div div { border-width:0 2px 0 2px; }
.dropShadow .drop4 div div { border-width:0 2px 0 2px; }
.dropShadow .drop5 div div { border-width:0 2px 0 2px; }

/*content being shadowed*/
.dropShadow .dropContent {
position:relative;
z-index:1;
background-color:white;
}

****************
***** HTML *****
****************

<div class="dropShadow dropBR" style="float:left; position:absolute;">
<div class="drop1"><div><div></div></div></div>
<div class="drop2"><div><div></div></div></div>
<div class="drop3"><div><div></div></div></div>
<div class="drop4"><div><div></div></div></div>
<div class="drop5"><div><div></div></div></div>
<div class="dropContent" style="border:1px solid black; padding:2px;">

<img src="birdhouse4.gif">

</div>
</div>

source

Hacks CSS para Safari y Google Chrome

/*Estilo común*/
body { background-color: red; }

/*Hack para navegadores con motor webkit*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
body { background-color: blue; }
}

source

CSS Min-height

body, html { height: 100%; }
#container { height: auto !important; min-height: 100%; height: 100%; }

source

HTML Test Page for CSS Style Guide

<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>

<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>

<hr />

<h1 id="headings">Headings</h1>

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

<small><a href="#wrapper">[top]</a></small>
<hr />

<h1 id="paragraph">Paragraph</h1>

<img style="width:250px;height:125px;float:right" src="images/css_gods_language.png" alt="CSS | God's Language" />
<p>Lorem ipsum dolor sit amet, <a href="#" title="test link">test link</a> adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.</p>

<p>Lorem ipsum dolor sit amet, <em>emphasis</em> consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.</p>

<small><a href="#wrapper">[top]</a></small>
<hr />

<h1 id="list_types">List Types</h1>

<h3>Definition List</h3>
<dl>
<dt>Definition List Title</dt>
<dd>This is a definition list division.</dd>
</dl>

<h3>Ordered List</h3>
<ol>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
</ol>

<h3>Unordered List</h3>
<ul>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
</ul>

<small><a href="#wrapper">[top]</a></small>
<hr />

<h1 id="form_elements">Fieldsets, Legends, and Form Elements</h1>

<fieldset>
<legend>Legend</legend>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus.</p>

<form>
<h2>Form Element</h2>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui.</p>

<p><label for="text_field">Text Field:</label><br />
<input type="text" id="text_field" /></p>

<p><label for="text_area">Text Area:</label><br />
<textarea id="text_area"></textarea></p>

<p><label for="select_element">Select Element:</label><br />
<select name="select_element">
<optgroup label="Option Group 1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</optgroup>
<optgroup label="Option Group 2">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</optgroup>
</select></p>

<p><label for="radio_buttons">Radio Buttons:</label><br />
<input type="radio" class="radio" name="radio_button" value="radio_1" /> Radio 1<br/>
<input type="radio" class="radio" name="radio_button" value="radio_2" /> Radio 2<br/>
<input type="radio" class="radio" name="radio_button" value="radio_3" /> Radio 3<br/>
</p>

<p><label for="checkboxes">Checkboxes:</label><br />
<input type="checkbox" class="checkbox" name="checkboxes" value="check_1" /> Radio 1<br/>
<input type="checkbox" class="checkbox" name="checkboxes" value="check_2" /> Radio 2<br/>
<input type="checkbox" class="checkbox" name="checkboxes" value="check_3" /> Radio 3<br/>
</p>

<p><label for="password">Password:</label><br />
<input type="password" class="password" name="password" />
</p>

<p><label for="file">File Input:</label><br />
<input type="file" class="file" name="file" />
</p>

<p><input class="button" type="reset" value="Clear" /> <input class="button" type="submit" value="Submit" />
</p>

</form>

</fieldset>

<small><a href="#wrapper">[top]</a></small>
<hr />

<h1 id="tables">Tables</h1>

<table cellspacing="0" cellpadding="0">
<tr>
<th>Table Header 1</th><th>Table Header 2</th><th>Table Header 3</th>
</tr>
<tr>
<td>Division 1</td><td>Division 2</td><td>Division 3</td>
</tr>
<tr class="even">
<td>Division 1</td><td>Division 2</td><td>Division 3</td>
</tr>
<tr>
<td>Division 1</td><td>Division 2</td><td>Division 3</td>
</tr>

</table>

<small><a href="#wrapper">[top]</a></small>
<hr />

<h1 id="misc">Misc Stuff - abbr, acronym, pre, code, sub, sup, etc.</h1>

<p>Lorem <sup>superscript</sup> dolor <sub>subscript</sub> amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. <cite>cite</cite>. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.  <abbr title="Avenue">AVE</abbr></p>

<pre><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. Donec faucibus. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.  <abbr title="Avenue">AVE</abbr></p></pre>

<blockquote>
"This stylesheet is going to help so freaking much." <br />-Blockquote
</blockquote>

<small><a href="#wrapper">[top]</a></small>
<!-- End of Sample Content -->

source

CSS .clearfix

.clearfix:after {content: ".";display: block;clear: both;visibility: hidden;line-height: 0;height: 0;}
.clearfix {display: inline-block;}
html[xmlns] .clearfix {display: block;}
* html .clearfix {height: 1%;}

source

HTML CSS media query

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML CSS media queries test</title>
<meta name="keywords" content="css, html, media queries, css3" />
<meta name="description" content="Test CSS 3 media queries dla html" />

<style>

table{ width: 100%}

table td:nth-of-type(1){
background: blue;
color: white;
}

table td:nth-of-type(2){
background: red
}

table td:nth-of-type(3){
background: green;
color: white

}

table td:nth-of-type(4){
background: yellow;
}

@media screen and (max-width: 510px){
table td:nth-of-type(4){
display: none;
}
}

@media screen and (max-width: 383px){
table td:nth-of-type(3){
display: none;
}
}

@media screen and (max-width: 281px){
table td:nth-of-type(1){
display: none;
}
}

</style>
</head>
<body>

<table border="1" summary="ZnikajÄ…ca tabela">
<caption>The znikajÄ…ca tabelka</caption>

<thead>
<tr><th>Ta nie znika</th><td>Znikam przy 281px szerokości</td><td>Nie znikam wogóle</td><td>Znikam przy 384px szerokości</td><td>Znikam przy 510px szerokości</td></tr>
</thead>
<tbody>
<tr><th scope="row">wrwerw</th><td>wewe</td><td>wewrwerwer</td><td>werwer</td><td>werw erwrwrewre</td></tr>
<tr><th scope="row">werwer</th><td>e</td><td>werwrew</td><td>weerwe</td><td>werwrewe</td></tr>

<tr><th scope="row">werwe</th><td>werrrwrerw</td><td>werwer</td><td>werwrwrwrwre</td><td>werwrewe</td></tr>
<tr><th scope="row">wrewerw</th><td>ewrewre</td><td>we</td><td>wwrwer</td><td>rewerwrrwwe</td></tr>
</tbody>
</table>

</body>
</html>

source

User stylesheet for Snipplr

@-moz-document url-prefix("http://snipplr.com/") {

code {

font-family:"Envy Code R", "Consolas", "DejaVu Sans Mono", "Anonymous Pro", "Courier New", monospace !important;

font-size:0.9em !important;

background-color:#E0E0E0 !important;

}

#meerkat-wrap, a.adhere, a.ad1, ins, #top-banner {

display:none !important; /*remove ads*/

}

}

@-moz-document url-prefix("http://snipplr.com/edit/"), url-prefix("http://snipplr.com/new/") {

#title, #tags, #url, #comment {

font-family:Arial, sans serif !important;

font-size:1em !important;

font-style:normal !important;

}

#source {

font-family:"Envy Code R", "Consolas", "DejaVu Sans Mono", "Anonymous Pro", "Courier New", monospace !important;

font-size:0.9em !important;

height:26em !important;

}

#comment {

height:11em !important;

}

#sidecol {

display:none !important;

}

#maincol {

margin-right:0 !important;

padding-right:0 !important;

border-right:0 !important;

}

#maincol p {

padding-right:15px !important;

}

#comment, #source {

width:100% !important;

}

}

@-moz-document url-prefix("http://snipplr.com/view/"), url-prefix("http://snipplr.com/view.php?codeview") {

div.description pre, .comments pre {

color:#000000 !important;

background-color:#E0E0E0 !important;

margin:1.4em !important;

border:1px dashed #E0E0E0 !important;

font-size:0.9em !important;

}

#innersource pre, #viewsource textarea {

font-family:"Envy Code R", "Consolas", "DejaVu Sans Mono", "Anonymous Pro", "Courier New", monospace !important;

font-size:13px !important;

}

#comment {

font-family:Arial, sans serif !important;

font-size:1em !important;

font-style:normal !important;

}

#viewsource .sourcenav {

text-align:right !important;

}

#viewsource .sourcenav .rgt {

float:none !important;

}

#viewsource .sourcenav ins { /*remove ads*/

visibility:hidden !important;

}

#sidecol h2:first-child, #sidecol ins { /*remove ads*/

/*display:none !important;*/

}

hr.dotted.marg + table, center ins { /*remove ads*/

display:none !important;

}

}

@-moz-document url-prefix("http://snipplr.com/") {

#sponsored-search { /*remove ads*/

display:none !important;

}

}

source