Skip to main content

Div and span

Div:
Div <div> tag is that it divides the HTML document into sections. Proper usage of the <div> tag is fundamental to good HTML coding, the <div> tag is one of the most powerful tools available to a web developer.

Span:
Span <span> is  in-line level elements, they only span across small amounts of content, typically words or phrases.
For example:
a <span> tag might be used to make a word red in color or to give it an underline.



Div Elements
The <div> tag is nothing more than a container for other tags. Much like the body tag Div elements are block elements and work behind the scenes grouping other tags together. Use only following attributes with your div element, anything else should be reserved for css.
  • id
  • width
  • height
  • title
  • style

Try out example:
Example of div
<html>
<head>
<style>
#container {
margin:0px auto;
background-color:black;
width:500px;
color:white;
}
</style>
</head>
<body>
<div id=”container”>
I love my country Nepal.
</div>
</body>
</html>


Example of span
<html>
<head>
<style>
.text {
font-size:24px;
color:white;
}
</style>
</head>
<body>
<div id=”container”>
I love my country Nepal.
</div>
</body>
</html>

Comments

Popular posts from this blog

CSS List

CSS allows you to customize the lists that can be made with HTML  to the extent that even images can be used as bullet points for unordered lists. CSS List Style Type If you want to use something different from the default numbering of ordered lists, or the bullets/discs of unordered lists, then all you have to do is choose a different style for your lists. CSS allows you to select from a wide variety of different list item shapes. Unordered list styles: square, circle, disc (default), and none Ordered list styles: upper-alpha, lower-alpha, upper-roman, lower-roman, decimal (default), and none Code:

Accessible Forms

Forms aren't the easiest of things to use for people with disabilities. Navigating around a page with written content is one thing, hopping between form fields and inputting information is another. Because of this, it is a good idea to add a number of elements to the form. Labels Each form field should have its own label. The label tag sorts this out, with a for attribute that associates it to a form element:

Join in MySQL

Join clause is used to combine rows from two or more tables depending upon common field between them. There are different kinds of Joins. The most common and useful Join is Inner Join. Inner Join: It will return all rows from multiple tables where the condition is met.