Docsity

HTML notes (TAGS) PRACTICAL, Study notes of Technology

Toggle sidebar
bg1
Made by Habiba 10E
HTML TAGS
Table
Code
What it does
Options
Caption
<caption> hello </caption>
(comes after the table tag)
allows you to display a
caption center aligned on
top of the table
Table
attributes
<table border=“1”>
shows/hides table gridlines
1, 0
<table align= “center”>
aligns a table in a window
left, right, center
Style attributes within an HTML tag (embedded css)
Code
What it does
Options
<table style= “width:40px;
height:40px;”>
Changes table width and
height
<td style=
“text align:center;”>
horizontally aligns cell
content
left, right, center
<td style=
“vertical-align:middle”>
Vertically aligns cell content
Top, middle, bottom
border
<table style= “border-collapse:
collapse”
Collapse- The table and
table cells’ borders are
joined and shared between
them.
Separate- the table and its
cells all have distinct
borders.
Collapse, separate
<table style= “border:solid
4px”>
<td style= “border:solid 4px”>
Border style can be applied
to external gridlines
Or internal gridlines where
this attribute is added to
cells
Solid, dotted, dashed,
double, groove
Can pick thickness of
the border here too
<table style= “
Border-spacing: 15px 30px”>
Sets spacing between the
borders of individual cells
To values are passed
to this property: the
horizontal spacing
first, then the vertical
spacing between cells
second
padding
<table style= “padding: 25px”>
Can be added to individual cells
in their <td> tag
Adds cell padding, which is the space between the
cell content and the border of the cell
This assigns all padding sides to be 25px.
pf3
pf4
pf5

Partial preview of the text

Download HTML notes (TAGS) PRACTICAL and more Study notes Technology in PDF only on Docsity!

HTML TAGS

Table

Code What it does Options

Caption hello (comes after the table tag) allows you to display a caption center aligned on top of the table Table attributes shows/hides table gridlines 1, 0 aligns a table in a window left, right, center

Style attributes within an HTML tag (embedded css)

Code What it does Options

Changes table width and height

horizontally aligns cell content left, right, center

Vertically aligns cell content Top, middle, bottom border

Border style can be applied to external gridlines Or internal gridlines where this attribute is added to cells Solid, dotted, dashed, double, groove Can pick thickness of the border here too

Sets spacing between the borders of individual cells To values are passed to this property: the horizontal spacing first, then the vertical spacing between cells second padding Can be added to individual cells in their tag Adds cell padding, which is the space between the cell content and the border of the cell This assigns all padding sides to be 25px.

Specific padding:

Is the same as

Used when the sides of the padding have different values, to specify the size of each side individually. You don’t need to add a padding to every side, if top padding is required, use padding-top; if all sides are required then use all the rest too To efficiently add padding to every side of the table. Order of padding sides when putting values in, are: Center, right, bottom, left colors This is blue Sets the text in between and to the color picked in the #RRGGBB format

Sets color of the background to the color picked in the #RRGGBB format Note that the hash symbol tells the browser that the number is in hexadecimal Inserting images, videos, audio Images A typical image tag: More on the image source (src) absolute reference of a file is the complete file path of that file in a computer. Relative reference of a file is when you refer to the file in relation to where you are. When mentioning the source of an image, make sure the image is in the same folder the web page is in, and write the image name with its file type (which is relative referencing) e.g. turtle.png when absolute referencing is not used, the browser looks into the current folder fo the image. This means that as long as the image is stored in the same folder as the web page, it will work properly, even if the web page is opened on another computer absolute referencing wont work e.g because the other computer would need to have the same folder structures (and most computers don’t have the same folder structures and will be different compared to your computer) more on the image alternative text (alt) if the image was not found in the same folder as the web page and relative referencing was used OR absolute referencing was used and the web page was opened on another computer, the image is not displayed, and the alternative text of the image will be displayed.

unordered apples bananas

  • apples
  • bananas nested Bullet lists can be nested by placing a bullet list within another list e.g.

fruits

apples bananas

vegetables

potatoes lettuce

  • fruits o apples o bananas
  • vegetables o potatoes o lettuce Hyperlink (read more in the book)

A hyperlink is defined between and

anchor top

A typical anchor tag Attributes: Href- hyperlink reference, which is the name of the destination anchor The name is always inside speech marks “” and has

before it

The text between the placeholder defines an ID for the hyperlink

This is the hyperlink reference tag for the location the anchor takes you to when it is clicked. It is placed in the location you want the anchor to take you to. Used to set a hyperlink to allow you to navigate within the page or to an external page

To other

web

pages

cie website Here the link to the other page is written in the href attribute with no # Make sure not to use an absolute address since it only works on your computer e.g. href=”C:my documents/my folder/next_page.html”

if the anchor takes you to a web page you made, make sure this web page has a hyperlink reference e.g. href= “next_page.htm” there’s no need for an address if this web page is in the same folder as the web page that has the anchor