Use if IE CSS in body? [duplicate] - html

This question already has an answer here:
Why is IE11 Ignoring Conditional Comment
(1 answer)
Closed 6 years ago.
I'm working with a really broken CMS and only have access to just below the opening body tag. I, unfortunately, had to input my CSS in there but of course now I need custom IE styling. <!--[if IE]> doesn't seem to be working in the body. Is there a way around this?

Thanks to Turnip, I now know IE 10 and up doesn't allow for conditional comments.

Related

Is it possible to print a page with HTML5 (without JavaScript)? [duplicate]

This question already has answers here:
Can we make Print button without JavaScript?
(4 answers)
Closed 6 months ago.
I am creating a web page for a special browser, which does not support JavaScript, only HTML, how can I print the page without JavaScript?
Browsers provide no features for printing documents which are not triggered by:
JavaScript
The browser's own UI

How can I change the style of the content of an iFrame with CSS? [duplicate]

This question already has answers here:
How to apply CSS to iframe?
(28 answers)
Closed 5 years ago.
I'm trying to use an iFrame to display an HTML webpage from an external source but, I can't get it to work with CSS.
You cannot do that (the browser won't let you, for security reason). If the external content of the iFrame is from the same server as the root page, then you can use javascript but no css from the root html.

Importance of Doctype in HTML [duplicate]

This question already has answers here:
What is the functionality of !DOCTYPE?
(5 answers)
Closed 7 years ago.
In modern HTML, is there a purpose to having a Doctype tag to start an HTML page? I'm wondering because when I add or remove it, nothing changes.
It helps the browser render the code correctly.

Are we able to properly use the `main` element yet? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
So I just remembered that people were going on about the main element and whether or not it's a good idea and whether or not we should use it or even have one to begin with. I also remember being against the idea of a main element.
But as I was typing <div id="main", I asked myself, "If I'm applying main to an id, then why not see if the main element has been standardized yet?"
So then I looked it up. HTML5 Doctor says yes we can use it. But from their article, it looks like it's still not fully supported. I know that we can use JavaScript to make things easier for late-comers (browsers not adopting the new Standards as quickly as others) - and I know that Can I use (.com) says the major browsers support it, but has anyone had any issues while using it?
Are there any reasons I'm not aware of why I shouldn't use it?
There is broad support for <main> but if you have to deal with older browsers, the following CSS rule will make it work for them
main {
display: block;
}
The CSS specification requires browsers to treat all elements they don't recognize as inline, so this rule tells them to treat it properly as block instead.
If you need to support a browser so old that it doesn't implement CSS, that's another ballgame.
Not trying to be a smart ass but to elaborate on Stephen Thomas' answer:
If you need to support IE8 or older you might want to add the latest version of the HTML5shiv (if you haven't already) or add this to the head of your page above your stylesheet(s):
<!--[if lt IE 9]>
<script>
(function (d) {
d.createElement('MAIN');
// ... more HTML5 elements
}(document));
</script>
<![endif]-->
And the CSS (as Stephen Thomas already described):
main {
display: block;
}

How to copy HTML and its associated CSS from any web page [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Tools to selectively copy html+css+js from existing sites
Is there any tool so you can select the HTML part you want to copy and then the tool bring you the CSS rules associated with that HTML.
Have u tired it with FireBug https://addons.mozilla.org/en-us/firefox/addon/firebug/ ??
https://getfirebug.com/