html.notes
html.notes
In addition to the basic input types, HTML forms offer other controls
like textarea and select for richer user interaction. These elements
allow for more complex data collection and provide a better user
experience. In this blog, we will dive into these form controls and provide
examples.
Copy
The rows and cols attributes define the visible dimensions of the
textarea.
<select name="fruits">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="cherry">Cherry</option>
</select>
Copy
Each option inside the select tag represents an item in the dropdown
list.
Copy
Conclusion
The textarea and select elements add another layer of interactivity
to HTML forms, allowing for more complex and useful data collection.
Understanding how to use these elements effectively can greatly
enhance your web application's user interface.
More on forms
HTML forms are the backbone of interactive websites. They allow users
to submit data, which can be processed on the server. While we have
covered basic input types in previous tutorials, this tutorial aims to delve
deeper into form attributes, both common and new HTML5 additions.
We'll also look at HTML5 validation attributes to ensure data integrity.
Common Attributes
action
The action attribute specifies the URL where the form data should be
sent after submission.
method
The method attribute defines how data is sent. The two most common
methods are GET and POST.
Copy
name
The name attribute specifies the name for the form element, making it
easier to reference in scripts or the server-side code.
Copy
placeholder
This attribute provides a hint to the user as to what can be entered in the
field.
Copy
required
The required attribute makes a field mandatory to fill out.
Copy
autofocus
The autofocus attribute automatically focuses the cursor on the
particular input when the page loads.
<input type="text" autofocus>
Copy
required
As mentioned above, this attribute makes a field mandatory.
Copy
pattern
The pattern attribute specifies a regular expression that the input must
match to be valid.
Copy
Conclusion
Copy
Copy
Replace favicon.ico with your file's path if different.
Step 4: Test
Open your site in different browsers to make sure the favicon appears.
In the next tutorial, we will talk about more HTML head elements
Copy
Copy
Conclusion
The <link> and <script> tags are crucial for linking external
resources like stylesheets and JavaScript files, enhancing the
functionality and presentation of your HTML documents.
Copy
Copy
SVG in HTML
Scalable Vector Graphics (SVG) has become an indispensable
part of modern web development. SVG enables developers to
create high-quality, scalable graphics that look crisp at any size
or resolution. In this blog post, we'll explore the basics of using
SVG in HTML, its benefits, and some practical examples.
What is SVG?
Scalability
SVG images can be scaled indefinitely without losing quality,
which is ideal for responsive web design.
File Size
SVG files are often smaller than their raster counterparts,
especially for simple shapes and icons.
Flexibility
SVGs can be styled, animated, and manipulated using CSS and
JavaScript.
How to Embed SVG in HTML
Copy
Copy
.background {
background-image: url('image.svg');
}
Copy
SVG Attributes
Practical Examples
iFrames in HTML
iFrames, or Inline Frames, are an integral part of modern web
development. They allow you to embed another HTML page
within your current page. In this blog, we'll delve into the utility
of iFrames, their attributes, and some use-cases.
What is an iFrame?
Basic Syntax
Copy
Attributes of iFrame
Practical Examples
<iframe src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0" allowfullscreen></iframe>
Copy
<iframe src="https://maps.google.com/maps?
q=LOCATION&output=embed" frameborder="0"></iframe>
Copy
Conclusion
Basic Usage
The most straightforward way to use the <code> tag is inline for
short code snippets:
Copy
Using <code> with <pre>
For multiline code snippets, it's common to combine
the <code> tag with the <pre> tag:
Copy
Conclusion
HTML Canvas
The <canvas> element in HTML is a powerful feature for
rendering graphics and shapes directly within web pages.
Though it's often paired with JavaScript for dynamic rendering,
the canvas itself is an HTML element. In this blog, we'll explore
what you can do with the <canvas> element alone.
What is Canvas?
Copy
Attributes of Canvas
You can also style the <canvas> element with CSS. For example,
to add a border:
canvas {
border: 1px solid black;
}
Copy
Conclusion
Attribute Description
Copy
Copy
Copy
Conclusion
HTML Entities
HTML entities are a crucial part of HTML markup language. They
enable you to display characters that are reserved in HTML or
that aren't readily available on the keyboard. In this blog, we'll
explore what HTML entities are, their types, and how to use
them.
What Are HTML Entities?
Copy
How to Use HTML Entities
Copy
Copy
<p>This is an example text.</p>
Copy
Conclusion
<blockquote> Tag
<blockquote cite="source-url">
Quotation text here.
</blockquote>
Copy
<q> Tag
Copy
Attributes
Practical Examples
<blockquote cite="https://example.com">
This is a long quote from an external source. This
quote can span multiple lines and paragraphs.
</blockquote>
Copy
Copy
You can style these tags using CSS to better match the
aesthetics of your website.
Conclusion
Copy
Copy
Copy
Modern Alternatives
It's better to use CSS for styling and layout as it separates content from
presentation.
Replacing <font>
Copy
Replacing <center>
Copy
Replacing <u>
Conclusion
Understanding obsolete HTML tags is not just a trip down memory lane;
it also emphasizes the importance of keeping up to date with the latest
web standards. Always opt for modern, semantic HTML and CSS for
styling to ensure your websites are future-proof.
< < Previous
Examples
Using UTF-8
<meta charset="UTF-8">
Copy
Using ISO-8859-1
Copy
Conclusion
Understanding and specifying the correct character set is crucial
for creating web pages that render text accurately across
different platforms and languages. UTF-8 is the most commonly
used and recommended character set due to its wide
applicability and support.