(tagged: public HTML web dev | personal ‣ ‣ ‣ ‣ )
Learn HTML by Building a Cat Photo App | freeCodeCamp.org
id
needs to be unique within that web page/html document, and any kind of element can have an id (afaik?)
label
with an input
, they still can’t share the same id
! one of them is always gonna use a separate attribute like for
to reference the id
of the other.div
has no height or width, which is why it’s basically invisibletype=text
for input
) would still work without the quotes, but they’re just recommended to always be included? anyway it sounds like at the very least you can’t go WRONG with always including them.id
is one of them, it should always go first (that’s just me making that up though lol)meta
element can maybe only have one attribute? like, you need to add two separate meta elements to declare charset
in one and viewport
in the other<html>
<head></head>
<body>
<header></header>
<main>
<section>
<article></article>
</section>
</main>
<footer></footer>
</body>
</html>
h1
, for the title of the pagemain
is all of the Content of the page, all the stuff that belongs only to this page rather than being repeated on others. it should exclude header, footer, and navigation.section
and h2
elements one-to-one - in other words, every time you’re making a new h2, that’s where you should mark off a new section; or, think of ‘section’ as “content that would fall under the same heading”
article
can get pretty dang small–like, the fcc example cafe menu does a separate article element for every single menu item. another usage would be if you had like a cms and each post in a feed is an article.<form action="url">
<input id="userinput" name="user" type="text" required>
<fieldset id="binarychoice">
<legend>binary choice</legend>
<label><input id="bin0" name="binary" value="0" type="radio" checked> 0</label>
<input id="bin1" name="binary" value="1" type="radio"><label for="bin1">1</label>
</fieldset>
<button type="submit">Submit</button>
</form>