css replace text image

#header h1 a{
display:block;
text-indent:-9999em;
background:(images/logo.png) no-repeat 0 0;
height:87px;
width:250px;
overflow:hidden;
}

Quote a piece of code. Replace text with an image, and has a hyperlink. <a> default label inline, first element block to block, to define its width and height, to adapt to the width and height of the picture. <a> height of the label should be the same picture. text-indent indents to the font to see the place, you can not delete the text, so you can make the image replacement text.

Reproduced in: https: //my.oschina.net/u/2410364/blog/484244

Intelligent Recommendation

CSS centers the image and text vertically

This question is a bit embarrassing, it took a long time to get it. I am not good at CSS, at least in the layout of this piece is still a mess. I don't know if I know too much about the android layout...

CSS sets the background of the text to an image

CSS3-Set the background of the text as an image 1. Effect Picture 2. Knowledge explanation Mainly applied to css3background-clipwithtext-fill-color,note:text-till-color:transparentYeswebkit kernelPriv...

css text image vertically centered

Both pictures and text need to be styled: vertical-align: middle; to ensure vertical centering (the code is a small program, change the view to div and image to img)...

More Recommendation

When the css text can't be displayed completely, replace the text with an ellipsis.

When the second line of text in css is incomplete, hide the text Insert picture description here The above four lines of code can be achieved......

When the text exceeds one line, hide it and replace it with... (implemented by CSS)

I ran into a problem in the project today. When the text exceeds one line, the text is hidden and replaced with.... At first, I thought that it was limited by the number of words in the text, and I wa...

CSS realizes multi -line text overflow to replace it with a omission number

CSS realizes multi -line text overflow to replace it with a omission number The effect is as shown in the figure below, -webkit-line-classp: 3; This number can be changed as needed...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top