HTML class not linking to internal CSS [closed] - html

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)

Related

How to center an image in the header? [closed]

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
So this is what i have Tried, which doesn't work.
Ive also tried to make it a block and then margin that as 0 auto, like other questions say, but that doesn't help at all...
<!DOCTYPE html>
<html>
<head>
<style>
.logo {
text-align: center;
}
</style>
</head>
<header>
<div id="logo">
<img src="logo.png">
</div>
</header>
</html>
I just cannot seem to center this image, and i would like to in as little lines as possible.
need # for id . is used for class
#logo{
text-align:center;
}
Edit
Answered in comments above
I recommend you to add the body tag and do not make mistakes between id and class.

Why is my heading and text not appearing? [closed]

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
I'm sure this is really simple, sorry but I'm a web noob. I can't get the headings to show up on the page.
<html>
<style>
body {
background: linear-gradient(to right, #bdc3c7, #2c3e50);
}
<style/>
<body>
<h1>That Was Then<h1/>
<p> A toronto based band <p>
<body/>
<html/>
The syntax for an end tag is </type> not <type/>.
This would have been picked up if you had used a validator.

Any way to write " *:nth-child(2) " in CSS? [closed]

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.

Color not being applied from css [closed]

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
I have the following
HTML:
<h1 class="largeTitle">Exikle</h1>
CSS:
h1.largetitle {
font-size: 9ee;
color: #2B547E;
}
However the color does not get implemented. I believe the code is correct so I'm not really sure what the problem is.
Wrong class and attribute
Class name are casesensitive and font-size is em not ee
Try
h1.largeTitle {
font-size: 9em;
color: #2B547E;
}
CSS is case sensitive with selectors(IDs & Classes) so h1.largetitle should be h1.largeTitle.

Referring to an image inside a table with CSS [closed]

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/