Reputation: 23322
I'm trying add some styling to the overall content on my page, but styling I add to the <content>
tag in the CSS doesn't show up anywhere.
JSFiddle:
Upvotes: 1
Views: 186
Reputation: 50203
<content>
is not a valid tag, as suggested in @BenM answer. Then just use a valid tag instead.
For the records, the hack to show it would be giving it a block level display attribute:
content {
width: 300px;
height: 300px;
background-color: green;
display: block;
}
Upvotes: 2
Reputation: 3117
I checked the fiddle.
The html written there is wrong as of my knowledge. Because I don't think there is any tag in HTMK known as <content>
.
Also head
should be in <html>
tag and before <body>
tag.
Below is a fiddle which works even with wrong tags
<head>
</head>
<body>
<div>
Goodbye Cruel World!
</div>
<footer>
</footer>
</body>
Upvotes: -1
Reputation: 389
i don't think this is universal defined html tag, and it's not all the time working with creating your own custom tags, i believe easier to use it as a div+class then
Upvotes: 0
Reputation: 53198
You can't style it because the browser doesn't understand <content>
. It was rejected from the HTML5 specification.
You'll need to replace it with another element (such as <article>
).
Upvotes: 8
Reputation: 38102
You need to target div
inside your content
instead:
content div {
width: 300px;
height: 300px;
background-color: green;
}
Upvotes: 1