Htmlcss
Htmlcss
HTML stands for HyperText Markup Language. It is the standard markup language used to
create and design web pages.
15. What is the difference between an inline element and a block-level element in HTML?
Inline elements do not start on a new line and only take up as much width as necessary.
Examples include <span>, <a>, and <img>. Block-level elements start on a new line and take
up the full width available. Examples include <div>, <p>, and <h1>.
<textarea>`), etc.
20. **What is the purpose of the `<form>` tag?**
- The `<form>` tag is used to create an HTML form for collecting user input. It contains
various form elements like input fields, buttons, checkboxes, etc.
21. **What is the purpose of the `target` attribute in the `<a>` tag?**
- The `target` attribute specifies where to open the linked document when the user clicks on
the hyperlink. It can take values like `_blank` (opens in a new window), `_self` (opens in the
same frame), `_parent` (opens in the parent frame), or `_top` (opens in the full body of the
window).
22. **What is the purpose of the `rel` attribute in the `<a>` tag?**
- The `rel` attribute specifies the relationship between the current document and the linked
document. It is commonly used to specify the relationship type in hyperlinks, such as
`stylesheet`, `nofollow`, `noopener`, etc.
CSS Questions:
1. What is CSS?
CSS stands for Cascading Style Sheets. It is a style sheet language used for describing the
presentation of a document written in HTML.
11. What is the difference between position: relative, position: absolute, and position:
fixed in CSS?
position: relative positions an element relative to its normal position in the document flow.
position: absolute positions an element relative to its nearest positioned ancestor or the initial
containing block.
position: fixed positions an element relative to the browser window, so it remains fixed in place
even when scrolling.