Home > Web Front-end > HTML Tutorial > How to control the maximum width of div? _html/css_WEB-ITnose

How to control the maximum width of div? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:26:08
Original
1297 people have browsed it

I set up a div, hoping that its height will change with the number of words, and its width is fixed. However, the current effect is that the width is also changing. How can I control the width of the div?


Reply to discussion (solution)

Try max-width

Try max-width How to write? I'm not very good at it. .


Try max-width. How to write it? I'm not very good at it. .

<div style="max-width:960px; min-width: 960px;"></div>
Copy after login

Set the maximum width and minimum width

How to fix the maximum width of the table?

The setting method is the same. But generally speaking, changing the height or width unilaterally will not affect the other. LZ still needs to check the JS to see

The setting method is the same. But generally speaking, changing the height or width unilaterally will not affect the other. LZ still needs to check the JS to see if it is good

Try setting a forced line break. As long as the specified width is reached, it will Line-wrapped

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template