Summary of several common CSS Problems

Source: Internet
Author: User

Summary of several common CSS Problems
1. Border Problems

The border is a dotted line]

border:1px dashed #ddd;

[Solid borders]

 border:1px solid #ddd; 

[Tr underlined border in table]

Make the following declaration in css:

 .mytable{border-collapse: collapse;} 

[The cell in the table has a broken border]

 
 


2. Some form Problems


[Add optional text information for Single-choice/check]


 

Note that when the label is used, the value of the for Attribute corresponds to the value of the id attribute of the element in the form.


3. Table Problems


[Alignment of text in td]

[Vertical alignment of td text]

 

Optional attribute value: top middle bottom baseline

[Horizontal alignment of td text]

 

Optional attribute value: left right center justify

Set the Row Height in tr]

We do not recommend using the height attribute to hide some content.

Line-height: 15px;/* This attribute is recommended */

[If the content in td is blank]

Please fill in with space characters: & nbsp;
In this way, even if there is no content, it will still fill in the blank

[Tr underlined border in table]

Make the following declaration in css:

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

4. Some problems with the scroll bar

[Do not want a scroll bar to appear]

 overflow:hidden;
[Do not want the horizontal scroll bar to appear]
 overflow-x:hidden; overflow-y:auto;

[Do not want a vertical scroll bar]

 overflow-y:hidden; overflow-x:auto;

[Do not want a scroll bar, but the vertical height increases with the content]

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

[Note:] using this method, you must ensure that the height of the auto-increment includes padding and margin. Otherwise, a vertical scroll bar will still appear.

Note that the elements in the dom (except the height, margin and padding must also be considered) do not exceed the actual height of the parent container.

[Modify some parameters in the horizontal direction]

[If you want to display a scroll bar, but it appears in the browser border scroll bar]

overflow:visible;






Related Article

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.