Home  >  Article  >  Web Front-end  >  Use div css to solve the problem of horizontal scroll bars_Experience exchange

Use div css to solve the problem of horizontal scroll bars_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:07:381651browse

A very depressing question, take a look at the code I originally wrote:


[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]

A horizontal scroll bar actually appeared. The problem is that the width I defined is only 950px. ! Finally, with the help of netizens, I discovered the reason:

1 You can directly change the css of the body to:
body{width:990px; margin:0; padding:0;}
2 You can add:

* {margin:0;padding:0;}The running effect after adding:

[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn