span padding: 0 10px; : span « Tags « HTML / CSS

HTML / CSS » Tags » span 
span padding: 0 10px;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns='' xml:lang='en'>
        <title>Descendant Selectors</title>
<style type='text/css'>
body {
    font-face: sans-serif;
h1 {
    margin: 5px;
    border: 1px solid rgb(200200200);
    background: rgb(234234234);
    padding: 5px;
    margin: 5px;
p.note {
    background: yellow;
    border: 1px solid gold;
span.code {
    font-family: monospace;
    padding: 0 10px;
p span.code {
    background: yellow;
p.note span.code {
    background: lightyellow;
            Descendant selectors apply styles based on ancestral relationships.
            <span class='code'>&lt;span&gt;</span> element named <em>code</em>,
            which is a descendant of <span class='code'>&lt;p&gt;</span> elements.
            To do this, the selector <span class='code'>p span.code</span> is used.
        <p class='note'>
            The note text is given different styles.  To do this another descendant
            selector is used.  This time the selector is <span class='code'>p.note

Related examples in the same category
1.'span' Example
2.span line-height: 0.6em;
3.span display: none;
4.span float: right;
5.span inside a h2
6.Empty span with background image
7.Using span to highlight one letter
8.Using span to create author part of a quotation
9.Using span to highlight
10.Span inside a DIV
11.Span padding: 0 57px;
12.Span color: #786B50;
13.Span display: block;
14.Span float: left;
15.Span letter-spacing: 6px;
16.Span width: 1000px;
17.Span position: absolute;
18.Span top: 206px;
19.Span left: 86px;
20.Span color: #140A00
21.Let DIV span two columns
22.span with class selector
23.span background: mistyrose;
24.span float left
25.span border: 1px solid rgb(200, 200, 200);
26.span background: rgb(244, 244, 244);
27.span background: white;
28.span border: 1px solid black;
29.Using span to create quotation
30.span.color {color:#FF0000;}
31.Capital first letter with span
32.Style a letter with span
33.Inline style for Span
34.The span element can be used to group inline elements only.
35.span with id style
36.Inline Spacer
37.Inline Decoration solid
38.Inline Decoration by border
39.Inline Decoration with image
40.span in a h2 with absolute position
41.SPAN in anchor
42.Span in a H2
43.Shrinkwrapped SPAN by setting both width and height to auto
44.Horizontally Stretched Absolute SPAN
45.Line break with margin top
46.Default line space with margin 0
47.One and half Line break with margin-top: 1.5em
48.Invisible inline horizontal rule: a line-break.
49.Double-border inline horizontal rule.
50.Background inline horizontal rule with image
51.Combination Inline horizontal rule.
52.Use SPAN to style Blocked area
53.Absolute centered  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.