id html css code example
Example 1: css id
<style>
#your_id{
color: blue;
font-size: 24px;
}
</style>
<h1 id="your_id">Example text</h1>
Example 2: css id
#id {
css declarations;
}
Demo
Example 3: how to call an id in css
<style>
#selector {
color: red;
}
</style>
<div id="selector">
<p>This is an id</p>
</div>
Example 4: id in css
#id{
color:red;
}
Example 5: html id
<style>
#grepperHeader {
background-color: lightblue;
color: navy;
padding: 40px;
text-align: center;
}
</style>
<h1 id="grepperHeader">grepperHeader</h1>
Example 6: html script id and class
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script class="foo" type="text/javascript">
function foobar() {
var a = 1;
}
</script>
<div id="showScript">Show me the script.</div>
<script type="text/javascript">
$('#showScript').click(function(event) {
event.preventDefault();
$("<div>").html($(".foo").text()).appendTo($("body"));
});
</script>