special thanks to Jan Michelfeit & Martin Kruliš
Create a simple HTML page
index.html
according to instructions in the file so that it looks like
the expected result.
Common HTML tags
<html>, <head>, <body>,
<title>, <script>,
<style>
<article>, <section>, <header>,
<footer>, <nav>, <h1>,
<h2>, …
<p>, <li>, <ul>, <ol>,
<div>
<a>, <span>, <br>,
<em>, <strong>, <u>,
<sub>, <sup>
<table>, <tr>, <td>,
<th>
<img>
<form>, <input>, <textarea>,
<select>, <option>,
<button>
Validate HTML
<p>ab <ul><li>cd</li></ul> ef</p>
valid?
alt
is required for <img>
Simple HTML Form
form.html
full_name
https://webik.ms.mff.cuni.cz/labs/documents/02-handle-form.php
HTML Form
form.html
to form-post.html
and edit the copy
Why?
<link rel="stylesheet" href="style.css"type="text/css">
<style type="text/css"> a { color: red; } </style>
<a href="#" style="color:red;">
Consider the following selectors:
li.sidebar a.external
div#navigation a[href^="http"]:hover
What is their specificity? Which one is more specific?
text-align
- alignment of inline content inside a block elementvertical-align
- alignment of an inline or table-cell boxmargin: auto;
to center block elementsmargin:auto
means 0px margin verticallyThis paragraph has bottom margin 25px
This paragraph has top margin 25px
Yet the space between us is only 25px instead of 50px
border-collapse
to avoid space between table cells:
border-collapse: | separate (default) |
border-collapse | collapse |
1 px
vs. 1px
)<body>
width/height
doesn't apply to non-replaced inline elements (replaced elements are e.g. <img>
,
<input>
, <textarea>
, etc.)
border
can be used as shorthand:
border-width
can be used as shorthand:
What do these mean?
border-width: 1px;
border-width: 1px 2px;
border-width: 1px 2px 3px 4px;
CSS Selectors
CSS Selectors