tags: CSS
Introduce the method of Gilder/Levin
<h2>
<span></span>Hello World
</h2>
<style type="text/css">
h2 {
width: 150px;
height: 35px;
position: relative;
}
h2 span {
background: url(hello_world.gif) no-repeat;
position: absolute;
width: 100%;
height: 100%;
}
</style>
First, set the position of H2 to relative , which will make the position of H2 in H2 as the reference, then position the SPAN element absolutely, fill the entire H2 area, and apply the background image to the SPAN tag. The principle is to overlay the SPAN tag on the text content. Once the background image in SPAN cannot be displayed, the text content of the lower layer will be displayed without affecting normal use. However, this method also has a drawback, that is, the background image cannot be transparent, otherwise the following text will be revealed.
First, add a picture Look at Legend "Data Data processing Add ICON: 'Image: //./img/ Alarm .png' will 'Question 1' Replace{name: 'title 1', icon: 'image: //./img/ Alarm .png'} Code: Effect: Secon...
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...
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...
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)...
One -line Multi-line...
Text replacement 1. Determine the event - click event 2. Usually events will trigger a function 3. The function usually goes to operate the page element and do some interactive actions. [...
CSS: #h2 { position: relative; width: 250px; height: 76px; overflow: hidden; } /* * The picture inside the spa...
ps: 1. The outermost box needs to be set relative to each other, and the elements in the box are set to be absolutely positioned; 2. The outermost box must be set to overflow hidden overflow: hidden; ...