HTML Flashcards
definition of tags in the syntax(7)
<html>-root/ parent tag
<head>-child tag
<body>-container
<title>-title of the web page
<h1>
<p>
<br></br>
</p></h1></title></body></head></html>
Current version of html
HTML 5 .1—2nd edition
html is introduced _______by in year______
Tim Berners Lee
1991
(6)definition of <tag></tag>
- Html tags are like keywords which defines how browser will format and display the content
- Helps a web browser to distinguish between html content and simple content
- contains three main parts:
-opening tag
-content
-ending tag - some tags do not have ending tag like <br></br>
- shd be enclosed within <>
- end tag shd have a sp. charac–”/”
attributes (4)
syntax
1.HTML attributes are special words which provide additional information about the elements
2.Each element or tag can have attributes, which defines the behaviour of that element
3.. always be applied with start tag
4. name and value pair.
syn:
<ele>content</end ele>
</ele>
features of HTML(8)
- Platform dependent
- Interpreted
- Easy to understand
- All browsers supports html
- Features supports
- Flexible
- note Programming language
- Can be supported by programming languages which make Web browser more dynamic
adv of HTML(5)
- Easy to learn
- not case sensitive
- execution is easy
- compiler is not required
- It can be easily integrated with other programming languages
disadvantages of html(3)
- Not secured
- Not platform dependent
- Errors are not displayed As
list
collection of data items is called as list
–list items–<li>
—three types:
1. Order list<ol>
2. Unordered list<ul>
3. description list<dl>
<ol> formats
</ol>
Number format(default) - <ol>
Alphabets capital letters -<ol type="A">
Alphabet small letters
Roman capital letters - <ol type="I">
Roman small letters - <ol type="i">
<ul> formats
</ul>
Disc(default) - <ul>
square-<ul type="list-style-type:circle">
circle
None
Nested list(3)
list inside another list is called as nested list
- nested list can be created for both<ul> and<ol>
- Default type of <ul> is circle(not disc)
-Default of<ol> is number itself
selectors(6)
1.ele selec–p{—on all para willbe aplied
2.sp.ele selec–p{–only on para without other selectors–only spefically selected ele
3. class selec– .hi{__
<p>--
4. grp selec-- h1,p,h2{\_\_
5.universal selec *{---
6. id selec-- #para{--
<p>\_\_\_</p>
</p>
How to get single line for a table outline
Border-collapse: Collapse;
— This should be written in style tag when :
table, th, td{
_____________
}
table–syntax
<style>
table, th, td { border: 1px solid black; } <table> <tr> <th>\_\_\_</th> </tr> <tr> <td>--</td> <tr> </table></style>
text box
name:<input></input>
How to increase the height of row or column
row:
<tr style=”height:200px>
—not in th
column:
<th style=”height:200px>
—not in tr
components of forms (7)
- Text box or text field
2 radio button
3 checkbox (select more than one field)
4 text area
5 select(Cannot select more than one field)
6 upload
7 buttons
<dl>
</dl>
adds description to data items
<dt>-data term
<dl>-data item
</dl></dt>
table tags(5)
<table>
<tr>--table row
<th>--table head
<td>--table data
<style>
---to declare table in head</style></td></th></tr></table>
Border styles(10)
Dotted
Dashed
Solid
double
Groove
Ridge
Inset
Outset
None
hidden
<caption>
padding
</caption>
name of the table– in <table>
size of the cell– in table th, td{
XHTML
- Creating web pages and documents
- Similar to H T M L but follows stictor rules of xml
- Exhtml is reformulation of html using xml rules
- It combines the flexibility of html with syntax of XML this means html documents must adhere to the stricter rules and guidelines
- XHTML 1.0 is released in 2000
- Its latest version is xhtml5
HTML vs xhtml
HTML (Hypertext Markup Language) and XHTML (Extensible Hypertext Markup Language) are both markup languages used for creating web pages and documents, but they have some key differences:
-
Syntax Rules:
- HTML: HTML is more forgiving of syntax errors. It doesn’t require lowercase tag names, attribute values in quotes, or properly nested elements. In HTML, you can often get away with sloppy code.
- XHTML: XHTML has stricter rules. All tag names and attribute names must be in lowercase, attribute values must be enclosed in double quotes, and elements must be properly nested and closed. This means you have to write cleaner and more consistent code.
-
Self-Closing Tags:
-
HTML: In HTML, some elements like
<img>
and<br>
can be left unclosed or use a self-closing syntax (e.g.,<img src="image.jpg">
). -
XHTML: In XHTML, all tags must be properly closed, and self-closing tags should end with a “/”. For example,
<img src="image.jpg" />
.
-
HTML: In HTML, some elements like
-
Document Structure:
-
HTML: In HTML, the document structure can be more lenient, and certain elements like
<html>
,<head>
, and<body>
can be omitted without causing issues. - XHTML: XHTML enforces a strict document structure, and all essential elements must be present for the document to be well-formed.
-
HTML: In HTML, the document structure can be more lenient, and certain elements like
-
Quoting Attributes:
-
HTML: Attribute values in HTML don’t necessarily need to be enclosed in quotes (e.g.,
<a href=index.html>
). -
XHTML: In XHTML, attribute values must be enclosed in double quotes (e.g.,
<a href="index.html">
).
-
HTML: Attribute values in HTML don’t necessarily need to be enclosed in quotes (e.g.,
-
Error Handling:
- HTML: Browsers are designed to handle common errors in HTML and often display the page even if there are syntax errors. This leniency can sometimes lead to unexpected results.
- XHTML: XHTML is less forgiving of errors. Even minor mistakes can result in a page not being displayed correctly. This can make debugging more precise but also less forgiving.
-
Compatibility:
- HTML: HTML is widely used and supported across various web browsers and platforms, which makes it a safer choice for general web development.
- XHTML: While XHTML was designed to be compatible with XML, it saw less adoption and support from web browsers and developers, leading to its decline in popularity.
-
MIME Types:
- HTML: HTML is typically served with a “text/html” MIME type.
- XHTML: XHTML is served with an “application/xhtml+xml” or “application/xml” MIME type.
In summary, XHTML is a stricter, more consistent, and cleaner version of HTML that follows XML rules. It enforces proper syntax and document structure. However, in practice, HTML5 became the dominant standard for web development, and XHTML saw less adoption due to its strict requirements and the greater flexibility provided by HTML5.