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
Release: 2016-06-24 12:24:06
Original
1749 people have browsed it

Academic Affairs Notice


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}
Copy after login
Copy after login

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}
Copy after login
Copy after login
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

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