Chapter2 Flashcards
how to make a hyperlink in html?
the ““a”” element is used to create a link to another page. “bra”a”bra”elexirs”bra”/a”bra”
the content of the ““a”” element is the link text. In the browser the link text appears with an underline to indicate that you click it.
the href attribute is how you specify destination of the link.
““a href=”elexir.html”"”elexirs”“/a””
What are attributes?
attributes give you a way to specify additional information about an element. With no attributes all we can supply is a descriptive name ,but with attributes we can customize the element with all kind of information.
Can I make an attribute myself?
Web browsers only know about a predefined set of attributes for each element. If you just made up attributes the browser wouldn’t know what to do with them. When a browser recognizes an element or an attribute we like to say that it “supports” that element or attribute. You should only use attributes that you know are supported.
That said, for programming web applications (the subject of Head First HTML5 Programming), HTML5 now supports custom data attributes that allow you to make up a custom name for new attributes.
what is href abbreviated for?
hyper text refrence
how to make an image a hyper link?
if you put an ““img”” element between the ““a”” tags, then your image will be clickable just like text.
Can I put any thing between the ““a”” tags and it will be clickable? Like say a paragraph?
You can indeed put a ““p”” element inside an ““a”” element to link an entire paragraph. You will mostly be using text and image (or both) within the ““a”” tag. but if you need to link a p or h1 tag you can.
What are the characteristics of a good organization system?
It must be flexible enough to grow, while keeping things as simple as you can.
Why not put an image folder in each folder, like “about” and “beverages”?
We could have. We expect some of the images will be reused among several pages, so we put images in a folder at the root (the top level) to keep them all together. If you have a site that needs lots of images in different parts of the site, you might want each branch to have its own image folder.
What is branch?
You can understand the way folders are described by looking at them as upside down trees. At the top is the root and each path down to a file or folder is a branch.
How to make a relative path?
you start from the page that has the link, and then you trace a path through your folders until you find the file you need to point to. First you identify the source folder, then you identify the destination folder, then you identify the path from source to destination.
How to go up one folder in relative path?
with ..
what do you do if you need to go up two folders instead of just one?
you can use “..” for each parent folder you want to go up. Each time you use “..” you’re going up by one parent folder. So if you want to go up two folders, you’d type “../..”. You still have to separate each file with the “/” so don’t forget to do that.
My operating system uses “"as a separator; shouldn’t I be using that instead of “/”?
No; in web pages you always use “/” (forward slash). Don’t use “" (backslash). Various operating systems use different file separators (for instance windows uses “" instead of “/”) but when it comes to the web, we pick a common separator and all stick to it. So whether you’re using Mac, Windows, Linux or something else, always use “/” in the paths in your HTML.
What is a relative path?
A relative path is a link that points to other files in your website relative to the webpage you are linking from. Just like on a map the destination is relative to the starting point.
is it allowed to use space for folder and file names?
NO! Don’t use space in the names you choose for files and folders for your website.