Home >Web Front-end >HTML Tutorial >All heroes, please help me! How to make text and images 10px away from the lower gray border?_html/css_WEB-ITnose

All heroes, please help me! How to make text and images 10px away from the lower gray border?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:24:061771browse

684271ed9684bde649abda8831d4d35584033ca97ae82723f40286aee9b31702Academic Affairs Notice39528cedfa926ea0c01e69ef5b2ea9b0
External CSS:
#sidebar h3 {
padding: 0px 0px 0px 5px;
height:27px;
line-height:40px;
color: #393939;
font-size: 12px; ;
}
#sidebar h3 img{
vertical-align:middle
}
I want the academic affairs notice and this small speaker image to be 10px away from the gray border at the bottom and adjust the padding. The top parameter cannot achieve the effect
Please help me!


Reply to discussion (solution)

#sidebar h3{
margin:0px
}

It may also be The padding and margin of #sidebar affect

Yes. The person above is right, lz only gave these. You can try margin: 0px; padding: 0px;

In this small menu, margin and padding will have default values, and its parent tag also exists. Even the outermost layer may affect it

LZ try adjusting the line-height?

You can try line-height. This is used to set the upper and lower positions of text in DIV.

Yes. The person above is right, lz only gave these. You can try margin: 0px; padding: 0px;

In this small menu, margin and padding will have default values, and its parent tag also exists. Even the outermost layer may affect it
Okay, I will post its parent


html, body, div, span, applet, object, iframe, h1, h2, h3, h4,img, ol, ul,p{	margin: 0;	padding: 0;	border: 0;	font-size: 100%;	background: transpa}

Yeah. The person above is right, lz only gave these. You can try margin: 0px; padding: 0px;
In this small menu, margin and padding will have default values, and its parent tag also exists. Even the outermost layer may affect it
Okay, I will post its parent


html, body, div, span, applet, object, iframe, h1, h2, h3, h4,img, ol, ul,p{	margin: 0;	padding: 0;	border: 0;	font-size: 100%;	background: transpa}
LZ can try to adjust the line-height

The title height is marked, so just set the row height.


Adjust the value of line-height.

margin-bottom: 10px

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