Prev | Current Page 228 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"


Another solution is to nest a fragment identifier within a div and then style the div to sit
at the top left of the web page. The HTML for this is the following:

THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
154
In CSS, you would then add the following:
div#topOfPageAnchor {
position: absolute;
top: 0;
left: 0;
height: 0;
}
Setting the div??™s height to 0 means it takes up no space and is therefore not displayed; setting
its positioning to absolute means it??™s outside the normal flow of the document, so it
doesn??™t affect subsequent page content. You can test this by setting the background color
of a following element to something vivid??”it should sit tight to the edge of the browser
window edges.
Link states
By default, links are displayed underlined and in blue when viewed in a web browser.
However, links have five states, and their visual appearance varies depending on the current
state of the link. The states are as follows:
link: The link??™s standard state, before any action has taken place
visited: The link??™s state after having been clicked
hover: The link??™s state while the mouse cursor is over it
focus: The link??™s state while focused
active: The link??™s state while being clicked
The visited and active states also have a default appearance. The former is displayed in
purple and the latter in red. Both are underlined.
If every site adhered to this default scheme, it would be easier to find where you??™ve been
and where you haven??™t on the Web.


Pages:
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240