CSS several common problems summary

Source: Internet
Author: User

1. Border part problem

"Border is dashed"

border:1px dashed #ddd;

"Border is a solid line"


"TR Plus underline border in table"

Make the following statement in CSS


"A cell in table has a discontinuous border"

<table cellspacing= "0" cellpadding= "0" ></table>


2. Part of the form problem


"Add text optional information to radio/check"


<form>  <label for= "male" >Male</label>  <input type= "Radio" name= "Sex" id= "male"/>  <br/>  <label for= "female" >Female</label>  <input type= "checkbox" name= "Sex" id= " Female "/></form>

Note When you use the label label, the value of the For property corresponds to the value of the id attribute of the element in the form


3. Table Part issues


"Alignment problem in TD text"

"TD Text Vertical alignment"

<TD valign= "Top" ></td>

Attribute Optional value: top Middle Bottom baseline

"TD Text Horizontal alignment"

<TD align= "center" ></td>

Property Optional value: Left Right center justify

"Set line height in TR"

Using the Height property is not recommended so that some content is hidden

line-height:15px; /* This property is recommended */

"TD If content is empty"

Use space character padding: &nbsp;
So even if no content will still fill in the blanks

"TR Plus underline border in table"

Make the following statement in CSS

. Mytable{border-collapse:collapse;}  tr{border:1px solid #ddd;}

4. scroll bar section problem

"Do not want to appear scroll bar"

Overflow:hidden;
"Do not want horizontal scroll bar"
Overflow-x:hidden; Overflow-y:auto;

"Do not want to appear vertical scroll bar"

Overflow-y:hidden; Overflow-x:auto;

"Do not want scroll bars but the vertical height increases with the content self-growth"

Overflow-x:hidden; Overflow-y:auto; min-hight:xxx px;

[Note:] This method must be used to ensure that the height of the self-growth includes the padding and margin or the vertical scroll bar will appear

It is important to note that the elements in the DOM (besides the height must also consider margin and padding) do not exceed the actual height of the parent container

"Then you can modify some parameters in the horizontal direction."

"If you want the scroll bar to appear, but it appears in the browser border scroll bar"

overflow:visible;






CSS several common problems summary

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.