-
target="_blank"
insert this in anchor element to open the redirection in new tab -
href="#"
for creating dead links -
<input type="text">
input element that accepts text as input -
<input type="text" placeholder="Something you wanna display in placeholder">
to display text in placeholder -
<form action="/url-where-you-want-to-submit-form-data"></form>
-
<button type="submit"> Submit </button>"
to submit the form to the url in the action -
<input type="text" placeholder="placeholder text" required>
to make the input feld mandatory to fill before submitting -
<label for="indoor"><input type="radio" id="indoor" name="outdoor-indoor">Indoor</label>
<label for="outdoor"><input type="radio" id="outdoor" name="indoor-outdoor">Outdoor</label>
Syntax of a radio button -
<label for="loving"><input type="checkbox" id="loving" name="personality">Loving</label>
<label for="caring"><input type="checkbox" id="caring" name="personality">Caring</label>
<label for="chutiya"><input type="checkbox" id="chutiya" name="personality">Chutiya</label>
Syntax of Checkbox -
value="WhateverTheNameOfYourOption"
This is to be kept inside the input element of your radio/checkbox -
<input type="radio" name="outdoor-indoor" checked>
For Making a Button checked by deafault if the user doesn't click on any option
-
<style> Here goes your css </style>
To Write css inside html file , just write the css in this block. Remeber to keep it inside the header of the page -
.small-font {
font-size: 16px
font-family: monospace;
}
For defining a specific font and font-size in css -
CSS borders have properties like style, color and width, Here's how to use them.
.thick-pink-border {
border-width: 10px;
border-color: pink;
border-style: solid;
}
-
border-radius: 50%;
For making the photo/element circular put border-radius as 50% -
background-color: silver;
For changing background color to silver/desired color -
An
id
has a higher specificity (importance) than a class so if both are applied to the same element and have conflicting styles, the styles of the id will be applied. -
Using an id Attribute to Style an Element
#cat-photo-form {
background-color: green
}
-
An element's
margin
controls the amount of space between an element's border and surrounding elements. -
An element's
padding
controls the amount of space between the element's content and its border.