About the positioning problem inside div in css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:08:04
Original
1106 people have browsed it

Please tell me, how can I position something inside a div? For example, I have a ul inside a div, but I want to control the ul to be lower in the middle of the div. How do I set it up? Seek answers online


Reply to discussion (solution)

Use margin padding
and absolute positioning both can

margin and padding Don’t you need to specify a specific value? Is there a similar method like setting center?

Generally, you just write a fixed value, or you can also use js to set it dynamically.

I generally use the following two attributes,
margin, outer border:
controls the size of the margin around the border. It contains 4 attributes: margin-top controls the width of the top margin, margin-right controls the width of the right margin, margin-bottom controls the width of the bottom margin, and margin-left controls the width of the left margin.
padding, inner border:
determines the amount of space padding surrounding the block element, which contains 4 attributes: "padding-top controls the width of the top blank, padding-right controls the width of the right blank, and padding-bottom controls The width of the lower margin and padding-left control the width of the left margin.

In addition, pay attention to: the absolute, relative and static properties of the position; setting this attribute will affect margin and padding. >

You can use margin padding

and absolute positioning

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!