Span in a H2 : span « Tags « HTML / CSS






Span in a H2

    




<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">
   <head>
      <title></title>
      <style type="text/css">
#h2 {
  position: relative;
  width: 250px;
  height: 76px;
  overflow: hidden;
}

#h2 span {
  position: absolute;
  width: 250px;
  height: 76px;
  left: 0;
  top: 0;
  background: url("http://www.java2s.com/style/logo.png") no-repeat;
}
</style>
   </head>

   <body>
<h1>Text Replacement</h1> 
<h2 id="h2" >Heading 2<span>This is a span.</span></h2> 

   </body>
</html>

   
    
    
  








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 padding: 0 10px;
24.span background: mistyrose;
25.span float left
26.span border: 1px solid rgb(200, 200, 200);
27.span background: rgb(244, 244, 244);
28.span background: white;
29.span border: 1px solid black;
30.Using span to create quotation
31.span.color {color:#FF0000;}
32.Capital first letter with span
33.Style a letter with span
34.Inline style for Span
35.The span element can be used to group inline elements only.
36.span with id style
37.Inline Spacer
38.Inline Decoration solid
39.Inline Decoration by border
40.Inline Decoration with image
41.span in a h2 with absolute position
42.SPAN in anchor
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