How to solve a problem in CSS Learning

Source: Internet
Author: User

As the end of the semester is approaching, the teacher wants to check our JSP job, so he has to start learning jsp from the beginning; now I have just learned CSS and encountered some problems, but I keep trying, finally, some examples are listed here:

There is an example:

CSS style sheet: Table. BANNER {
Background: url(bannerw.bg.jpg) Repeat-X;
Width: 100%;
}
Table. Links {
Background: url(button%bg.jpg) Repeat-X;
Font-size: 12px;
Width: 100%;
}
A {
Width: 80px; Height: 32px;
Padding-top: 10px;
Text-Decoration: none;
Text-align: center;
Background: url(button1.jpg) No-Repeat;
}
A: link {color: #654300 ;}
A: visited {color: #654300 ;}
A: hover {
Color: # ffffff;
Text-Decoration: none;
Background: url(button2.jpg) No-Repeat;
}

The HTML code is:

I wrote this for the sake of beauty.

<Table cellpadding = "0" cellspacing = "0" class = "Links">
<Tr> <TD> <a href = "#"> homepage introduction </a>
<A href = "#"> online users </a>
<A href = "#"> query users </a>
<A href = "#"> online friends </a>
<A href = "#"> friend list </a>
<A href = "#"> View message </a>
<A href = "#"> send message </a> </TD> </tr>
</Table>

The result is that each navigation bar has a gap when you move the mouse up, but if the code is written as follows:

 

<Table cellpadding = "0" cellspacing = "0" class = "Links">
<Tr> <TD> <a href = "#"> homepage introduction </a>
<A href = "#"> online users </a> <a href = "#"> query online users </a> <a href = "#"> online friends </ a> <a href = "#"> friend list </a> <a href = "#"> View Messages </a> <a href = "#"> send messages </a> </TD> </tr>
</Table>

The gap can disappear.

For example, <Div class = "">

</Div> T there is a gap below the image. The elimination method is: <Div class = ""> </div>

If you are interested, you can try it. I hope that students who are learning jsp can help each other and avoid detours. I hope you will always come to me:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.