Basic HTML And CSS Flashcards
What is the top-most required first line of the HTML file?
Less-than !DOCTYPE html greater-than
What is the characteristic of a block-level element?
There is always a line before and after the block.
List block-level elements (4 types).
P, h1-h6, form, div
Describe inline tags
They don’t cause a line break.
In the latest browsers, what is the effect of the title attribute?
It provides text that will show up in a hover.
What are some tags that are singleton and do not need a closing element:
br img and hr
NOTE: the trailing slash like br is required in xhtml
What does the alt tag used for in the <img></img>
If the source (src) image is not found (fails to load), then the alt text will be displayed in its place.
Show example of a table header section
lt tr>
lt th>column 1 lt/th>
lt th>column 2 lt/th>
lt/tr>
Where does the section of a table FOOTER definition go?
Immediately after the heading section.
What is the difference between background and background-color in the element styling?
None
What is the html for a dropdown list
lt select >
lt option value=”Mustang”> Mustang lt\option>
List the attributes common for a drop down list (select)
name
multiple - can select multiple
size - max # of visible options
How do you associate a label with a form element:
lt Label for =”FullName”> Full Name lt /Label>
lt input name=”FullName” />
Describe the field set element
Groups the elements;
Can contain separate forms;
Can add disable attribute to disable the fieldset group
After applying a background-image to a screen, what problem occurs in its use and how can you correct it.
By default, it repeats horizontally and vertically. To make it repeat in only one direction:
background-repeat: repeat-x
In CSS styling, how would you specify styles that apply to everything.
*{
margin: 0 auto 0 auto;
text-align: left;
}
What does margin: auto do?
For example: margin: 0 auto 0 auto
Auto causes the margin to be automatically computed: the contents will be centered within the container with equal space on the left and the right.
So (the example) 0 top margin, auto right, 0 bottom, auto left.
When elements have been given float left/right and we want to add the next element below these, what CSS will prevent the previous floats from affecting out ‘next’ element.
In the css block: clear : both
How do we remove bullets from a ul list.
With a css of list-style : none
How can we make ul list elements (li) show horizontally?
By default, the li elements are block elements. #menu ul li a { // the anchor (links) display:inline
How can we remove the underlines from anchor links?
Css: text-decoration : none;
How do we specify a styling of bold?
font-weight : bold
Use css3 to provide rounded corners
border-radius: 10px;
How can we prevent previously selected links from displaying in a different color?
Style it like: #leftmenu a:visited {
How can we change the color of anchor tags that are hovered?
Styling: a:hovered {