admin管理员组文章数量:1356304
I have absolutely zero idea about web design.
If you go to .php you will find that the CSS, JavaScript and HTML codes have been separately mentioned. How do I integrate them? The CSS and JavaScript should go inside head tag?
I have absolutely zero idea about web design.
If you go to http://caroufredsel.frebsite.nl/examples/carousel-lightbox-tooltip.php you will find that the CSS, JavaScript and HTML codes have been separately mentioned. How do I integrate them? The CSS and JavaScript should go inside head tag?
Share Improve this question edited Feb 13, 2019 at 19:42 halfer 20.4k19 gold badges109 silver badges202 bronze badges asked May 28, 2012 at 8:39 user1155386user1155386 1851 silver badge6 bronze badges 3- How do you mean integrate them? Do you want to have all the code in the HTML-file? – Christofer Eliasson Commented May 28, 2012 at 8:43
- Googling for html example, css example, javascript example could have taken less time than posting here – archil Commented May 28, 2012 at 8:49
- 2 +1 I think the simplicity of the question is rather unique. Even when Googling now the results are very different and can be confusing to a newer. – arttronics Commented May 28, 2012 at 8:57
3 Answers
Reset to default 3Yes, you are correct that they can be integrated in the Head Section.
For example:
<style type="text/css">
/* Place the contents of the file.css here */
</style>
<script type="text/javascript">
// Place the contents of the file.js here.
</script>
You need to have something like
<link rel="stylesheet" href="css/style.css">
<script src="js/script.js"></script>
inside the head of your .html file.
It would be even nicer if you could put your JavaScript not in the head, but at the end of the body tag.
This implies you have
- an .html file
- a folder called css which contains a style.css file where you have... all your CSS of course
- a folder called js which contains a script.js file where you have your JavaScript code
If it is necessary you can have all the code in one file.
In a very simplified way:
<html>
<head>
<script>/*javascript goes here*/</script>
<style>/*css goes here*/</style>
</head>
<body>/*content goes here*/</body>
</html>
本文标签: Integration of CSSJavascript and HTMLStack Overflow
版权声明:本文标题:Integration of CSS, Javascript and HTML - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744042256a2580879.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论