HTML and CSS Reference
In-Depth Information
Figure 7.4
Using the hover
pseudo-class
HANDS-ON PRACTICE 7.2
You will use pseudo-classes to create interactive hyperlinks in this Hands-On Practice as
you create a series of pages that contain hyperlinks styled in different ways.
Part 1
The first page contains text links that you will configure to use CSS pseudo-classes. A
sample is shown in Figure 7.5. When the mouse hovers over a link, it will change color
and the underline will disappear. You will code embedded CSS to configure the link,
visited, focus, hover, and active pseudo-classes for the anchor selector.
Figure 7.5
The hyperlink's
underline disappears
when the mouse
hovers
Launch Notepad and type the following XHTML:
<!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" lang="en" xml:lang="en">
<head>
<title>CSS Pseudo-class Example 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
body {
margin: 0 auto;
width: 400px;
text-align: center;
}
Search WWH ::




Custom Search