Can you put CSS style block (ie <style type="text/css">...</style>) on an ascx page, in order to style the user control? I tried it and it works. However I wonder if this is a common practice and the problem is the style block is inserted into the final HTML right where the user control is supposed to be. My understanding is style blocks should be between the <head></head> tags at the front. So it does seem to be out of place. BTW can javascripts be put any where on the HTML?
Can you put CSS style block (ie <style type=text/css>…</style> ) on an ascx page,
Share
Javascript tags can be placed just about anywhere. The head seams like the logical place to put it but some people recommend placing it at the very bottom just before
</body>. This way the content of your page should load faster and might improve SEO.Stylesheets should definitely be placed in the
<head>as it is a W3C recommendation.When using stylesheets take Tim’s advice to sneak them into the head, or better yet just use an external .css file.