Can someone help me to understand what am i doing wrong? Want to add an image at the top center but it doesn't show anything. Here is a css code.Thank you.
div.header {
background: url(photo/header.png) no-repeat ;
display: block;
width: 1002px;
height:178px;
}
try changing the path of the image like (../photo/header.png)
can u make a folder stucture?. is the html file and photo folder in same folder?
I think we need more information about the problem. There is maybe a typo in your code. If you use the background or background-image property, you have to use quotation marks. Like this: background: url('photo/header.png') no-repeat;
Related
I uploaded icons to my menu using class and css code (Wordpress + Elementor), but I can't remove the space between the icon and the text.
Used the following code example:
.frio
{
background-image: url('https://zine.unlatino.com/wp-content/uploads/2022/05/icon_frio.svg');
background-repeat: no-repeat;
background-position: left;
background-size: 30px;
padding-left: 5px;
}
Maybe I'm missing correctly modifying the code so that the text follows after the icon.
Thank you!
try adding to your class css
margin-left:5px; // based on ur preference
if that dosen't work u can try the following
position:relative;
left:5px; // based on ur preference
altghought i recommend you try to find what's going on using the development tool
I don't know if it's the best solution, but removed the CSS and added
<img src="https://zine.unlatino.com/wp-content/uploads/2022/05/icon_frio.svg" width="32" height = "32" />
in front of the text and aligned as expected.
If there is any other solution feel free to comment.
I have tried to implement the following code but nothing happens
#masthead {
background: url('data05/mono/public_html/wp/wp-
content/themes/spacious/images/monostaff1024x512.png') no-repeat center;
background-size: cover;
}
I am having no luck. IS my file to path format incorrect?
There is a space in your url after the "wp-"
data05/mono/public_html/wp/wp-
content/themes/spacious/images/monostaff1024x512.png
Also the formatting seems off, see background property.
I am having a problem setting the right place to one link in my css code:
The link is a text "hide" placed on the upper right corner on the footer banner of this website: http://iknowfirst.com
I want to place a little bit lower
The specific css code is here: http://iknowfirst.com/wp-content/plugins/yith-footer-banner/assets/css/style.css
Besides that, I cannot see the image: "images/mailwhite.png" that is set to show on the email field.
Someone can give me a light?
Thanks in advance!
the text "hide" inside ul.hiderzone - you need to decrease margin-bottom for the ul.
About css:
css path is:
http://iknowfirst.com/wp-content/plugins/yith-footer-banner/assets/css/style.css
path to image written as
url(../images/mailwhite.png)
so, real image path is:
http://iknowfirst.com/wp-content/plugins/yith-footer-banner/assets/images/mailwhite.png
UPD: you copy css rules into page body, so fix line 266.
Instead:
background-image: url("../images/mailwhite.png");
place:
background-image: url("/wp-content/plugins/yith-footer-banner/assets/images/mailwhite.png");
Here is the solution for your 2 issues
1) Placing a link
Solution : in your CSS
.hiderzone {
right: 10px;
top: -12px; /*Edit this, this will help you*/
bottom: 2px;
/*top: auto;*/ /*You should not use "TOP" twice */
list-style: none; }
2) You can use relative or absolute image path
Relative Path
background-image: url("../images/mailwhite.png");
Absolute Path
background-image: url("/wp-content/plugins/yith-footer-banner/assets/images/mailwhite.png");
I feel retarted for even having to post something like this but for being a vet in css I have no idea why this time I can't get an image to show in the background of a div. Here is what I have
#leadarea {
background-image:(images/submarines-for-sale-at-seamagine.jpg);
background-repeat: no-repeat;
background-position:center;
height:360px;
width:1160px;
}
<div id="leadarea"></div>
I have triple checked my path to the image and its correct. In the same directory of the file I have an folder called "images" and the file to that image. If I type in the full url to that image in a browser I can see the image. Why is my div not showing that image?
The proper syntax is:
background-image:url('images/submarines-for-sale-at-seamagine.jpg');
Also notice that the path is relative to the .css file placement.
Put the url in your background-image
background-image: url("your-image-path.jpg");
Try this to optimize your background definition in one line:
#leadarea {
background: transparent url("http://1.bp.blogspot.com/-5PauJ-PHxns/UVjwME0X9YI/AAAAAAAAA4s/lsd9ZRsfCnE/s1600/coelho+escolha.jpg") no-repeat center;
// background: color url("your-image-path.jpg") repeat position;
height: 400px;
width: 400px;
}
Check the example here: http://jsfiddle.net/R5cJp/2/
I'm new to CSS and was hoping someone could help me understand what I'm doing wrong. I'm trying to get an image to show up but it seems that no matter what I do it refuses to display on my page. Can someone please explain to me what I'm doing wrong?
Image saved in: Users/NenaH77/assignment/images/sitebg.jpg.
Css file is saved under: Users/NenaH77/assignment/css/style.css
body{
background: url('../images/sitebg.jpg') no-repeat top top #31b8ea;
}
By having ../images I thought the image saved in the folder was suppose to go up 2 levels and into my css folder so I don't understand why my image isn't showing up :(
Your CSS background declaration is invalid:
top top should be top or top left or some other valid combination of positions.
Try :
body {
background: url('../images/sitebg.jpg') no-repeat 0 0 #31b8ea scroll;
}
You need should probably put the background color first.
body { background: #31b8ea url('../images/sitebg.jpg') no-repeat top }
Mr. Slayer gave you the right answer though.
To go up 2 levels do this
background: url('../../images/sitebg.jpg') no-repeat top top #31b8ea;
This will work. You can see the fiddle here.
body { background: url(../../img/image.jpg) no-repeat center center; background-size: cover;}
This will also take you up two levels...
I just ran into this same problem. What worked for me was putting the full path of the image from my pc, instead of from just inside the project folder.
So in this case use
body { background: url('C:/Users/NenaH77/assignment/images/sitebg.jpg')}
Instead of
body { background: url('../images/sitebg.jpg')}