How can I keep the small icons in front of the css title text?

Reported answer
How can I keep the small icons in front of the css title text?
Ask online customer service
Scan the code to ask online customer service
  • Number of answers

    five

  • Number of browses

    3,050

5 answers Default sorting
  • Default sorting
  • Sort by time

Didn't find a satisfactory answer? Go ask Doubao AI intelligent assistant
Adopted
The solution is to put the position of the picture and the title under the same style control.
The example code is as follows:
div class=menubar
H3 class=h3a hrer=# class=one Menu Title/a/h3
/div

.h3{background:url(123.jpg) no-repeat 4px 6px; line-height:25px;font-size: 14px; margin:0; }
cancel comment
Two methods:
1、 Adjust the small picture as the background of h3, namely:
.menubar h3{font-size: 14px; font-weight: bold; text-align: left; margin:0;background:url(123.jpg) no-repeat left center; Padding left: the width of the picture;};
2、 Add img scr=123.jpg align=absmiddle/to center the image absolutely;
The first case is recommended, if the image is still needed elsewhere;
cancel comment
Set to auto. There are two methods:
1、 Adjust the small picture as the background of h3, namely:
.menubar h3{font-size: 14px; font-weight: bold; text-align: left; margin:0;background:url(123.jpg) no-repeat left center; Padding left: the width of the picture;};
2、 Add img scr=123.jpg align=absmiddle/to center the image absolutely;
The first case is recommended. If this picture is needed elsewhere
cancel comment
Take the picture as the background of h3, add an appropriate padding to h3 so that small pictures can be displayed, and then use the background positioning control to make it easier.
cancel comment
How about locating small icons directly in the background?
cancel comment
ZOL Q&A > mobile phone > other > How can I keep the small icons in front of the css title text?

Top mobile phone rankings

See more rankings>

report

Thank you for contributing to the harmony of the community. Please select the type of report

Reported successfully

It will be handled after verification
Thank you for your contribution to community harmony

Scan the code to participate in the trial of new products at 0 yuan
You can get the sheets and grand gifts on the top floor

 Scan and pay attention to us
Tips

Are you sure you want to cancel this registration and exit this activity?