I have created a function that enables Header Image in Wordpress (5.0.3) ACP. My HTML code treats that image as normal image (not background).
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
How can I make my custom header as background image?
I have created a function that enables Header Image in Wordpress (5.0.3) ACP. My HTML code treats that image as normal image (not background).
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
How can I make my custom header as background image?
Share Improve this question asked Feb 9, 2019 at 19:28 Mix911Mix911 11 bronze badge1 Answer
Reset to default 0Because you have used it as an image.
<img src="//..." height="..." width="..."/>
This code is used to display images, not background images.
Use it with text:
<div style="background-image: url(../images/test-background.gif); height: 200px; width: 400px; border: 1px solid black;">Example of a DIV element with a background image:</div>
Or without text:
<div style="background-image: url(../images/test-background.gif); height: 200px; width: 400px; border: 1px solid black;"> </div>
Source is enter link description here
I tried it with the header tag...
<header style="background-image: url(.../images.png)";>
Your text here.
</header>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744857254a4597482.html
评论列表(0条)