How to change a background color of a row from a table on hover with CSS

You can improve readability of data which is in table by changing the color of row when users mouse over it, to highlight the row they are reading. For example you can add the next additional CSS rule to the set of rules described in the article How to display spreadsheet data in an […]

How to display table rows in alternating colors with CSS

Displaying table rows in alternating colors is a common way to help users identify which row they’re focused on. You can use CSS classes to create this effect. You can add to the CSS rules shown in the article How to display spreadsheet data in an attractive and usable way with CSS one additional […]

How to display spreadsheet data in an attractive and usable way with CSS

You can style the table using CSS, which keeps markup to a minimum and allows you to control your data table’s appearance from the style sheet. You can create a .css file by following the next steps:

1. You can provide a basic rule for <p>, <td> and […]

How to add a borders to a table with CSS

The HTML border attribute doesn’t create the prettiest of borders for tables. You can use a CSS border, which gives you more flexibility in terms of design.

You can use the next CSS code to specify the border around the table:

.datatable

{

border: 4px solid #04B404;

border-collapse: collapse;

}

You can render the border around table […]

How to use HTML table specification tags and attributes

The (X)HTML table specification includes tags and attributes which you can use to ensure that the content of the table is clear when it’s read out to users who can’t see the layout. In the next test.html file these tags are marked with bold.

File test.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” lang=”en-US”>

<head>

<title>How to […]

How to use lists to create a navigation system with sub-navigation with CSS

You can use a sub-list to display navigation with sub-navigation. The next example is based in the approach discussed in the article How to use a structural list as a navigation menu with CSS. In the next test file the modified part is in bold:

 

File test.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” lang=”en-US”>

<head>

<title> […]

How to create rollover navigation with CSS

You can use CSS :hover pseudo-class selector, to create a an attractive  rollover effect—when a user holds their cursor over the button, it displays in a different way. Using the list navigation example from the article How to use a structural list as a navigation menu with CSS, you can add the next CSS […]

How to create a button-like navigation with CSS

You can use CSS to create a button-like navigation. The effect is based on usage of the CSS border properties.

You can use the next test file to see how it works:

File test.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” lang=”en-US”>

<head>

<title>How to create a button-like navigation with CSS</title>

<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />

How to use lists to make a horizontal menu with CSS

You may need to create a Web site with a horizontal menu close to the top of the document. In this case you can follow the next steps:

1. Prepare a list which you will use as menu. You can use the next test.html file as example.

 

File test.html

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML […]

How to use a structural list as a navigation menu with CSS

You can use a list to mark up places that users can visit on the site. You have to follow the next steps:

1. Create your list, placing each navigation link inside an <li> tag.

2. Wrap this list in a <div> with an […]

Recommended ASP.NET Examples