HTML & Css
HTML & Css
HTML
HTML (HypertextMarkup Language): A Web Designing language that is used to create the structure
of the web document. All other technologies of the web development works with the html.
What is HyperText?
Hypertext means a text which is linked and controlled by another text.
What is Markup?
Markup is a Latin word which means print.
There are a few things you need before getting on with HTML. Let me list them out:
A text editor
A browser
A storing device and some storage media
Your creativity
HTML files are plain text files containing tags. Tags makes this plain text as hypertext.
Tags: Tags are like commands of the html. Tags are responsible to perform all the task in html.
Open Notepad:
Now type the following:
<HTML>
<HEAD>
<TITLE>My first HTML page</TITLE>
</HEAD>
<BODY>
This is my first HTML page.
</BODY>
</HTML>
BASIC TAGS
THE <BR> TAG
<HTML>
<HEAD>
<TITLE>Testing the BR tag</TITLE>
</HEAD>
<BODY>
[1]
Vikas Singh
This is a long piece of text consisting of three
sentences and shows you the functions of the
Line Break tag. This tag is used quite frequently
to add line breaks in the HTML code. It is also used
to add blank lines to a document.
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Testing the BR tag</TITLE>
</HEAD>
<BODY>
This is a long piece of text consisting of three<BR>
sentences and shows you the functions of the<BR>
Line Break tag. This tag is used quite frequently<BR>
to add line breaks in the HTML code. It is also used<BR>
to add blank lines to a document.<BR>
</BODY>
</HTML>
The <BR> tag has no end tag because it doesn't need too. Just the presence of <BR> adds a line
break.
I am heading 1
<H2>I am heading 2</H2> gives:
I am heading 2
<H3>I am heading 3</H3> gives:
I am heading 3
<H4>I am heading 4</H4> gives:
I am heading 4
<H5>I am heading 5</H5> gives:
I am heading 5
<H6>I am heading 6</H6> gives:
I am heading 6
[2]
Vikas Singh
Physical Tags
There are 10 physical tags each requiring a closing tag:
Tag Nesting
<h1><center><u>Application Form</u></center></h1>
LOGICAL TAGS
Comments are some plain text that can be used within the program for documentation. This text is
not for the output file.
<HTML>
<HEAD>
<TITLE>Testing Comment tags in HTMLs</TITLE>
</HEAD>
<BODY>
I am visible.
<!-- I am not displayed by the browser -->
</BODY>
</HTML>
[3]
Vikas Singh
<!--
This comment
spans multiple lines
making the code easy to read
after a few months.
-->
I am centrally aligned
WIDTH Attribute:
<HR width="70%"> specifies that the length of the rule should be 70% of the page's width as:
SIZE Attribute
[4]
Vikas Singh
<HR align="center" width="50%">: Centrally aligned; there is no need to specify this explicitly as
this is the default.
NOSHADE Attribute: You would have noticed that the horizontal rules are shaded, they have this
3D kind of effect. If you don't want this, use the NOSHADE attribute. NOSHADE takes no values.
COLOR Attribute:
<MARQUEE>
The <MARQUEE> tag provides some animated text to the page. Unfortunately, it is supported only
by Internet Explorer (and WebTV).
Alternate Effect :
<marqueedirection="right"width="250"height="200"behavior="alternate">Hi</marquee>
Nested Marquee
<!doctype html><html><head><title></title></head><body>
</marquee>
</marquee>
</body></html>
Program 2:
<marqueedirection="down"width="250"height="200"behavior="alternate"style="border:sol
id">
<marqueebehavior="alternate">
hello
</marquee>
</marquee>
[6]
Vikas Singh
<FONT COLOR="BLUE">Blue Text</FONT>
1. Item One
2. Item Two
3. Item Three
4. Item Four
Types:
[7]
Vikas Singh
<LI>Item Two
<LI>Item Three
<LI>Item Four
</UL>
is displayed as
Item One
Item Two
Item Three
Item Four
Item One
Item Two
Item Three
Item Four
webdevelopersnotes.com
A great place to learn web developement.
fontmagic.com
One of the largest font sites on the Internet.
[8]
Vikas Singh
Some special characters are not available in keyboard. We can use following short notations to print
it. These characters are also called character entities.
Note: All tags in HTML are enclosed by < and > signs. To display these signs, you have to use their
special character notations. Thus, to display <HTML>, you have to write the < and > signs in their
special notations as <HTML>.
<A HREF="../../index.html">Homepage<A>
[9]
Vikas Singh
Three kinds of images files .gif, .jpg and .png are used on the Internet.
The anchor tag places a colored border around the image. You can remove this border by specifying
"0" as the value of the BORDER attribute in the <IMG> tag.
Any image, whether .gif, .jpg, .png or animated gif can be made into a hot spot using this technique.
<A HREF="mailto:[email protected]"></A>
Send me your feedback on this tutorial</A>
Use<BGSOUND> tag as
For a browser compatible background sound, use <EMBED> (see below for more details on this
tag).
<EMBED SRC="desprado.mid" HIDDEN="TRUE" AUTOSTART="TRUE"></EMBED>
If you want to make use of a plug-in, you would have to put the audio file inside an <EMBED> tag.
The <EMBED> tag takes many attributes. Some important ones are.
[11]
Vikas Singh
Audio tag:
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
autoplay autoplay Specifies that the audio will start playing as soon as it is ready
loop Loop Specifies that the audio will start over again, every time it is finished
preload auto Specifies if and how the author thinks the audio should be loaded
metadata when the page loads
none
Video Tag:
autoplay autoplay Specifies that the video will start playing as soon as
it is ready
loop loop Specifies that the video will start over again, every
time it is finished
muted muted Specifies that the audio output of the video should
be muted
[12]
Vikas Singh
preload auto Specifies if and how the author thinks the video
metadata should be loaded when the page loads
none
<TABLE BORDER="1">
<TR>
<TD>Row 1, Cell 1</TD>
<TD>Row 1, Cell 2</TD>
<TD>Row 1, Cell 3</TD>
</TR>
<TR>
<TD>Row 2, Cell 1</TD>
<TD>Row 2, Cell 2</TD>
<TD>Row 2, Cell 3</TD>
</TR>
</TABLE>
Row 1, Cell 1 Row 1, Cell 2 Row 1, Cell 3
Attributes of <TABLE>
ALIGN:
BACKGROUND:
BGCOLOR:
BORDER:
BORDERCOLOR:
[13]
Vikas Singh
BORDERCOLORDARK and BORDERCOLORLIGHT:
CELLPADDING:
CELLSPACING:
FRAME: <table frame=”void”> {lhs, rhs, above,below,hsides,vsides,box}
HEIGHT:
WIDTH:
HTML FRAMES:
Similarly,
ROWS="10%, *"
[14]
Vikas Singh
will place the first frame in 10% of horizontal space and the rest will be occupied by the second
frame.
SRC: A required attribute that takes the URL of a page as value and loads it in the frame.
ALIGN: aligns the inline frame with respect to other elements on the page. Values taken are
'TOP', 'BOTTOM', 'MIDDLE', 'LEFT' and 'RIGHT'.
HEIGHT and WIDTH: Specifies the dimensions in pixels.
HSPACE and VSPACE: Specifies amount of horizontal and vertical space to be put around
the inline frame. Value has to be a number that denotes pixels.
MARGINHEIGHT and MARGINWIDTH: Determines the amount of space in pixels
between the left-right and top-bottom edges of the frame and its contents.
FRAMEBORDER: Value can be '1' which puts a 3D border around the frame or '0' which
removes this border.
SCROLLING: A value of 'YES' forces the display of scrollbars. 'NO' removes scrollbars
even if they are needed. 'AUTO' lets the browser decide on inclusion of scroll bars depending
on the contents.
NORESIZE: Prevents users from resizing the frame.
NAME: Assigns a name to the frame so that it can be referred by it.
HTML FORM:
<INPUT TYPE="TEXT">
<INPUT TYPE="PASSWORD">
<INPUT TYPE="RADIO">
<INPUT TYPE="CHECKBOX">
[15]
Vikas Singh
<INPUT TYPE="BUTTON">
<INPUT TYPE="RESET">
<INPUT TYPE="SUBMIT">
<INPUT TYPE="HIDDEN">
<INPUT TYPE="IMAGE">
<INPUT TYPE="FILE">
<SELECT>...</SELECT>
<TEXTAREA>...</TEXTAREA>
<BUTTON>...<BUTTON>
<OPTION>...</OPTION>
NAME: Sets a name for this form element. You can give any name to your text field as long
as you don't duplicate it in the same form.
SIZE: Determines the size. The value taken is a number.
MAXLENGTH: Specifies the number of characters a user can submit thru this element.
VALUE: Specifies a default value that is displayed inside the text field when a user first
opens the page.
<INPUT TYPE="CHECKBOX">
CHECKED:
NAME:
VALUE:
<INPUT TYPE="RADIO">
CHECKED:
NAME:
VALUE:
HTML form
<INPUT TYPE="FILE">
Attributes taken are:
ACCEPT: Its value is a MIME type/s that your server program is ready to accept. A comma-
separated list of mime types can be supplied.
NAME: Specifies a name for the element.
VALUE: Specifies the default text inside the text field.
<INPUT TYPE="IMAGE">
This is a great tag allowing designers to make their own buttons. With its use you can replace the dull
default button with a colorful image.
[16]
Vikas Singh
SRC: a required attribute that points to the URL of the image file.
NAME: Gives a name to the element.
ALIGN: aligns the surrounding text with respect to the image.
BORDER: sets the border around the image. If zero is assigned as its value, no border is displayed.
<INPUT TYPE="HIDDEN">
This creates a form input field which is not displayed in the browser. It is ideal for passing values set
by the programmer or by certain actions of the user.
<OPTION></OPTION>
VALUE:
SELECTED:
[17]
Vikas Singh
Which system do you use?
<SELECT NAME="platform" SIZE="1">
<OPTION VALUE="win">Windows
<OPTION VALUE="mac">Macintosh
<OPTION VALUE="unix" SELECTED>Unix
<OPTION VALUE="oth">Other
</SELECT>
To define a value for the TEXTAREA, include the text between the start and end tags.
Fieldset: to draw a line around the grouped element of a form by fiedlset tag .
<form action="/action_page.php">
<fieldset>
<legend>Personalia:</legend>
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="birthday">Birthday:</label>
<input type="date" id="birthday" name="birthday"><br><br>
<input type="submit" value="Submit">
</fieldset>
</form>
<datalist id="Course">
[18]
Vikas Singh
<option value="CSS">
<option value="JAVASCRIPT">
<option value="REACT">
<option value="DJANGO">
</datalist>
<BUTTON>...........</BUTTON>
NAME:
TYPE:
VALUE:
Color autocomplete
date autofocus
datetime form
datetime-local formaction
email formenctype
month formmethod
number formnovalidate
range formtarget
search height and width
tel list
time min and max
url multiple
week pattern (regexp)
placeholder
required
step
[19]
Vikas Singh
Input Type: number
The <input type="number"> is used for input fields that should contain a numeric value.
You can set restrictions on the numbers.
Depending on browser support, the restrictions can apply to the input field.
Example
<form>
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
Example
<form>
Quantity:
<input type="number" name="points" min="0" max="100" step="10" value="30">
</form>
[20]
Vikas Singh
You can use the following attributes to specify restrictions: min, max, step, value.
Example
<form>
Telephone:
<input type="tel" name="usrtel">
</form>
[22]
Vikas Singh
HTML5 Semantic Elements
New Semantic Elements in HTML5
<article>
<aside>
<details>
<figcaption>
<figure>
<footer>
<header>
<main>
<mark>
<nav>
<section>
<summary>
<time>
Input Restrictions
Here is a list of some common input restrictions (some are new in HTML5):
Attribute Description
Disabled Specifies that an input field should be disabled
Max Specifies the maximum value for an input field
Maxlength Specifies the maximum number of characters for an input field
Min Specifies the minimum value for an input field
Readonly Specifies that an input field is read only (cannot be changed)
Required Specifies that an input field is required (must be filled out)
Size Specifies the width (in characters) of an input field
Step Specifies the legal number intervals for an input field
Value Specifies the default value for an input field
Autocomplete=”on” To autocomplete entries
Autofocus To auto focus on a box
Details Tag:
<h1>What is computer</h1>
<details>
<summary>Definition</summary>
<p>Computer is an electronic device which is derived from human intelligence. It accepts raw facts
and figures and convert it into meaningful information. </p>
</details>
Figure and figcaption
<figure>
<img src="n1.jpg" alt="nature" style="width:100%">
<figcaption>Figure.1 : Beauty of Nature</figcaption>
</figure>
Progress bar:
[23]
Vikas Singh
<MAP>...</MAP>
<MAP NAME="site">
...
Content
...
</MAP>
<MAP NAME="site">
[24]
Vikas Singh
Meta Tags - HTML Meta tags - Keyword - Refresh - Redirect
Meta tags are generally used to include information about a document such as author name, creation
date, copyright information etc. They always placed between the <HEAD> tags of an HTML
document.
HTTP-EQUIV or NAME
CONTENT
OR
<META HTTP-EQUIV>
The HTTP-EQUIV attribute takes one of the values mentioned below:
CONTENT-TYPE: The most commonly used content type is text/html. Other types can be
employed to include the character set for the document. This helps the browser to load the
appropriate character before document display.
EXPIRES: Specifies the date and time after which a document should be considered expired.
This can be used by web robots update content in a search engine.
CACHE-CONTROL: Determines the caching of the document.
CONTENT-LANGUAGE: Used to specify the language in which the document is written.
REFRESH: This value is commonly used to either redirect users to a different page or refresh the
contents of the present page.
Note that all the META tags with HTTP-EQUIV attributes also contain the CONTENT attribute.
The HTTP-EQUIV="REFRESH" demands more attention here, so let us have a detailed look at it.
The tag above simply refreshes the contents of the page in 5 seconds. However, you can supply a
URL to this tag, which redirects users to that page.
Note that there is only one set of quotes that encloses the content of CONTENT. Both the time in
seconds and the URL are inside the same quotes.
A cheap trick is to construct a looping (or non-looping) slide show making use of these tags. Let's
say you have three html pages named slide1.html, slide2.html and slide3.html. You can make a
looping slide show by including the appropriate META tag in each document.
[25]
Vikas Singh
slide1.html contains
<META HTTP-EQUIV="REFRESH" CONTENT="10; URL=slide2.html">
slide2.html contains
<META HTTP-EQUIV="REFRESH" CONTENT="10; URL=slide3.html">
slide3.html contains
<META HTTP-EQUIV="REFRESH" CONTENT="10; URL=slide1.html">
To start the slide-show, load slide1.html in the browser. After 10 seconds, slide1.html is replaced by
slide2.html, which is again replaced by slide3.html after 10 seconds. Finally, after another 10
seconds, slide1.html replaces slide3.html and thus, the slide-show keeps on looping. Note that the
<META> tag is placed in the head section of each document.
<META NAME>
Though there are some fixed values for the NAME attribute, you can construct your own meta tags
with it. Let's look at the important values
KEYWORDS: You can supply keywords for your pages using this. It helps in indexing by
search engines. Takes a list of comma separated keywords.
COPYRIGHT: Contains copyright information.
DESCRIPTION: lets you specify a description of the page.
AUTHOR: You can write your name here.
ROBOTS: This tag is used to stop your pages from being indexed by robots. Its an
alternative to the robots.txt file.
About CSS
What does CSS stand for?
CSS stands for Cascading Style Sheets.
What is CSS?
CSS is a language that you can use to define styles against any HTML element. These styles are set
using CSS properties.For example, you can set font properties (size, colors, style etc), background
images, border styles, and much more.
HTML has its limitations when it comes to layout. CSS helps us achieve such layouts. With CSS,
you have much better control over the layout of your web pages. You can specify exactly how big a
font will be, exactly where an element will be on a page, what the page will look like when printed,
and much more.
[26]
Vikas Singh
Advantages of CSS
CSS saves time
When most of us first learn HTML, we get taught to set the font face, size, colour, style etc
every time it occurs on a page. This means we find ourselves typing (or copying & pasting)
the same thing over and over again. With CSS, you only have to specify these details once for
any element. CSS will automatically apply the specified styles whenever that element occurs.
Pages load faster
Less code means faster download times.
Easy maintenance
To change the style of an element, you only have to make an edit in one place.
Superior styles to HTML
CSS has a much wider array of attributes than HTML.
Disadvantages of CSS
Browser compatibility
Browsers have varying levels of compliance with Style Sheets. This means that some Style
Sheet features are supported and some aren't. To confuse things more, some browser
manufacturers decide to come up with their own proprietary tags.
Fortunately, browser compatibility is becoming less of an issue as the latest browser versions
are much more standards-compliant than their earlier counterparts.
The CSS syntax consists of a set of rules. These rules have 3 parts: a selector, a property, and a value.
The selector is often the HTML element that you want to style. For example: h1{color:blue}
This code tells the browser to render all occurrences of the HTML <h1> element in blue.
Grouping Selectors:
You can apply a style to many selectors if you like. Just separate the selectors with a comma.
Text Properties
Font Any of the above values {font: italic bold 10px arial} CSS1
separated by spaces.
Color/Background Properties
[28]
Vikas Singh
background-color (color), transparent Color is in hex code. CSS1
background- Border-box,padding-
clip: padding-box; box,content-box
Box Properties
Margin Any of the above margin {margin: 5px 2px 5px 3px} CSS1
values in top, right, bottom, When only one value is
left order separated by present, all margins are
spaces. affected.
[29]
Vikas Singh
padding-left (length), (percent) Length is in pixels. CSS1
Padding Any of the above padding {padding: 5em 6em 3em CSS1
values in top, right, bottom, 6em}
left order separated by When only one value is
spaces. present, all sides are
affected.
[30]
Vikas Singh
Classification
Visual Effects
[31]
Vikas Singh
Visibility inherit, visible, hidden CSS2
Cont (string), (uri), (counter), Used with the :before, :after CSS2
attr(X), open-quote, close- pseudo-elements.
Ent quote, no-open-quote, no-
close-quote, inherit
counter-reset (identifier) (integer), none , Used with the counter() and CSS2
inherit counters() functions of the
content property.
counter-increment (identifier) (integer), none , Used with the counter() and CSS2
inherit counters() functions of the
content property.
Visual Formatting
[32]
Vikas Singh
Height auto, inherit, (length), Length is in pixels. CSS2
(percent)
Tables
[33]
Vikas Singh
empty-cells show, hide, inherit CSS2
Implementing CSS
There are 4 ways of implementing CSS: declare inline, embed into the head of your document, link
to an external CSS file, import a CSS file.
Inline CSS
Style sheet information is applied to the current element. Instead of defining the style once, then
applying the style against all instances of an element (say the <p> tag), you only apply the style to the
instance you want the style to apply to.
For example:
Embedded CSS
You embed CSS information into an HTML document using the 'style' element. You do this by
embedding the CSS information within <style>... </style> tags in the head of your document.
For example, place the following code between the <head>... </head> tags of your HTML
document:
p {color:#ff9900;}
</style>
Now, whenever any of those elements are used within the body of the document, they will be
formatted as instructed in the above style sheet.
External CSS
An external style sheet is a separate file where you can declare all the styles that you want to use
throughout your website. You then link to the external style sheet from all your HTML pages. This
means you only need to set the styles for each element once. If you want to update the style of your
website, you only need to do it in one place.
For example:
1. Type the following into a plain text file, and save with a .css extension (eg,
external_style_sheet.css).
[34]
Vikas Singh
p {font-family: georgia, serif; font-size: x-small;}
h1 {color: #000099; }
2. Add the following between the <head>... </head> tags of all HTML documents that you
want to reference the external style sheet.
Imported CSS
You can use the @import rule to import rules from other style sheets.
Add either of the following between the <head>... </head> tags of all HTML documents that you
want to import a style sheet into.
In CSS, classes allow you to apply a style to a given class of an element. To do this, you link the
element to the style by declaring a style for the class, then assigning that class to the element.
In CSS, classes allow you to apply a style to a given class of an element. To do this, you link the
element to the style by declaring a style for the class, then assigning that class to the element.
[35]
Vikas Singh
.class-name { property:value; }
If you want to use the same class name for multiple elements, but each with a different style, you can
prefix the dot with the HTML element name.
html-element-name.class-name { property:value; }
<style type="text/css">
p.css-section { color:green; }
</style>
You can also select elements (or classes) that's nested within another element or class. For example,
div.css-section p will select all <p> elements that are nested within a <div> element that uses the
.css-section class.
One major benefit of doing this is that you don't need to apply a class to every instance of an element
when it's nested within another element that uses a class.
Here's an example:
<body>
</div>
</body>
Using div.css-section>p (note the >) will only select the first<p> element inside the same <div>
element.
IDs allow you to assign a unique identifier to an HTML element. This allows you to define a style
that can only be used by the element you assign the ID to.
[36]
Vikas Singh
CSS ID Syntax
The syntax for declaring a CSS ID is the same as for classes - except that instead of using a dot, you
use a hash (#).
#id-name { property:value; }
Again, similar to classes, if you want to use the same id name for multiple elements, but each with a
different style, you can prefix the hash with the HTML element name.
html-element-name#id-name { property:value; }
CSS ID Example
<head>
<style type="text/css">
div#css-section { border:1px dotted red; }
</style>
</head>
<body>
<div id="css-section">CSS IDs can be very useful</div>
</body>
A{}
A:link{}
A:visited{}
A:hover{}
A:active{}
Relative Units(em(direct parent), rem(root parent), vh(1% of View port height), vw(1%
of view port width), % relative to parent
Cursor:
*{box-sizing:border-box;}
box-shadow:40px 20px 10px 20px green inset,-40px -20px 10px 20px green inset;
box-shadow: 5px 5px blue, 10px 10px red, 15px 15px green;
filter: filter:The filter property defines visual effects (like blur and saturation) to
an element (often <img>).
img {
filter: grayscale(100%);
}
Background-image:Linear-gradient(to right,red,green,blue)
Background-image:Linear-gradient(120deg,yellow,blue)
Background-image:Conic-gradient(red,green,blue)
background-image:repeating-radial-gradient(circle,red ,
yellow ,green10%);
<!DOCTYPEhtml>
<html>
<head>
<style>
#first {
height: 150px;
width: 150px;
background-image: radial-gradient(closest-side at 60%55%, red, yellow,
black);
}
#second {
height: 150px;
width: 150px;
background-image: radial-gradient(farthest-side at 60%55%, red, yellow,
black);
}
#third {
height: 150px;
[38]
Vikas Singh
width: 150px;
background-image: radial-gradient(closest-corner at 60%55%, red,
yellow, black);
}
#fourth {
height: 150px;
width: 150px;
background-image: radial-gradient(farthest-corner at 60%55%, red,
yellow, black);
}
</style>
</head>
<body>
<h2>closest-side:</h2>
<divid="first"></div>
<h2>farthest-side:</h2>
<divid="second"></div>
<h2>closest-corner:</h2>
<divid="third"></div>
<h2>farthest-corner (default):</h2>
<divid="fourth"></div>
</body>
</html>
opacity:0.5;
overflow:visible
overflow:scroll
overflow:auto
overflow:hidden
Clear:left or right
#dv{visibility:hidden} // hide the element but remains the area of the element
z-index:1;
flex box
make parent:
display:flex
flex-flow:row wrap
Transform
A:hover{display:inline-block;transform:scale(2,3)}
A:hover{display:inline-block;transform:rotate(90deg)}
A:hover{display:inline-block;transform:translate(20px,30px)}
A:hover{display:inline-block;transform:skew(30deg,35deg)}
matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY())
Transition:
transition-duration:1s
transition-delay:2s
transition-timing-function:ease-in-out;
Transition: property,duration,transition-timing-function,delay
[41]
Vikas Singh
Animation:
media query
<html>
<head>
<title> First Web Page</title>
<style>
#x{height:500px;width:600px;background-color: blue;}
@mediascreen and (max-width:500px) and (max-height:400px){
#x{height: 200px;width: 200px;}
}
</style>
</head>
<body>
<divid="x"></div>
</body>
</html>
<style>
#dv1{height: 400px;width: 500px;background-color: red;font-size: 15vw;}
@mediascreen and (max-width:600px){
#dv1{height: 200px;width: 200px;background-color: yellow;}
}
@mediascreen and (min-width:601px) and (max-width:800px){
#dv1{height: 300px;width:300px;background-color: blue;}
}
@mediascreen and (min-width:801px) and (max-width:900px){
#dv1{height: 350px;width:350px;background-color: green;}
}
@mediascreen and (min-width:901px) and (max-width:1000px){
#dv1{height: 300px;width:300px;background-color: pink;}
}
</style>
</head>
<body>
<divid="dv1">hello</div>
</body>
[42]
Vikas Singh
pseudo classes
pseudo elements
<element contenteditable="true|false">
User-select:
div {
html {
scroll-behavior: smooth;
https://www.sktthemes.org/
clip-path: circle(40%)
[43]