Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Okay, so this question could hardly be more basic, but... Why does this CSS rule not pick up the image inside the table?
# HTML
<table id="support-people"><tr><td>
<img src="http://news.bbcimg.co.uk/img/1_0_1/cream/hi/news/news-blocks.gif" /></td>
</tr></table>
# CSS
#support-people img {
width: 50px;
}
JSFiddle to show that the CSS is not being applied: http://jsfiddle.net/96F8H/
And if anyone can recommend me some kind of in-browser tool to pick up this kind of thing, bonus points...
It works fine. The problem was you had your CSS rule in the Javascript field. Here's a link with the things in the correct fields: http://jsfiddle.net/Skooljester/zHvx9/.
Your CSS is in the JavaScript box in your demo. Here's a corrected version.
If the example in the question is your actual code, you'll need to wrap the CSS with style tags:
<style type="text/css">
#support-people img { width: 50px; }
</style>
Mostly because you put the CSS in the Javascript part of JSFiddle.
Here's the working version with the CSS moved to the CSS section of the page: http://jsfiddle.net/96F8H/2/
It works fine. You put the css in the javascript section:
http://jsfiddle.net/96F8H/1/
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
When using the background-image I notice that it will not work with images from a direction web page link, like this:
body {
background-image: url("http://www.example.comenter/2312.jpg");
}
But if I link it directly from a folder directory it works just fine like such:
body {
background-image: url("C://Users/Jane/Desktop/2312.jpg");
}
Why is does it not work with an url link?
It works fine with a URL link:
body {
background-image: url("http://via.placeholder.com/400x200");
}
Actually It works, however you should review if the link is available.
The background-image property specifies an image to use as the background of an element.
Just check the link that your are specifying in url may be that path does not consist any image or please check image path that you want to display in webpage.
body {
background-image: url('http://www.publicdomainpictures.net/pictures/130000/velka/pink-simple-background.jpg');
}
<html>
<head>
</head>
<body>
<h1 style="color:white">Hello World</h1>
</body>
</html>
You can use like this:
body{
background: url('http://www.example.comenter/2312.jpg');
}
If it is not works the following link does not have any image, try another image.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
<html>
<head>
<style>
img.cardoption {width=20px;}
</style>
</head>
<body>
<img class='cardoption' src='http://s32.postimg.org/9vao2t9kl/scc_std.png'/>
</body>
</html>
In this simple piece of HTML, and accompanying CSS, I have an image with class name 'cardoption'. In the style tag in the head, I have attempted to set the width of this image to 20px.
However, for some reason the image is not resizing. Can someone please explain why?
Use
img.cardoption {width:20px;}
Replace = with :
(= is used for HTML attributes and : is used for CSS)
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I need to hide the second child of a div (#parentDiv) irrespective of the html-tag p, h2, h3 or div.
I could write all possible combinations in CSS, but it seemed to be clumsy as the html-tag of the element here can vary and is unpredictable. So I suppose writing up all HTML-tags is not a good approach.
Hence I tried below generalized approach in CSS, but did not work.
#parentDiv *:nth-child(2) {
display: none;
}
I do not need a JavaScript solution.
The code looks good and fine.. Check for brackets. You may have forgot to close brackets.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
It seems I can use display: none; on a button.
I can use visibility: hidden; but it doesn't do exactly what I want since the button is still present (just not display). Any other way I could remove a button using css only ?
Change this
<button style='display: none></button>
To This
<button style='display: none;'></button>
create a class in css file assuming it will be style.css
.nodisplay {
display:none;
}
and in your button
<button class="nodisplay"></button>
This way you can use the nodisplay class where ever you want on your site and no need to define style='display: none;' again and again in different HTML elements you want to hide
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Why does this doesn't work?
*:hover {margin-left:50px;}
Cause when I move over the element nothing happened.
Are you putting it at the end of your CSS file? If not, it may be getting overwritten.
*:hover {
margin-left: 50px;
}
is working for me.
What browser are you testing on?
Try the code below
body *:hover {margin-left:50px;}
try
body :hover{
margin-left: 50px;
}
this will apply the :hover to every inner element in body
I've just tested on Chrome and seems to work