HTML and CSS Reference
In-Depth Information
Note: Too Many Decimal Places?
You'll notice the decimal-based percentage values we're using are specified
using an inordinate number of decimal places. There has been some discus-
sion as to whether this many decimal places is necessary. As it stands, it's
probably only necessary to include about three decimal places. But things
could change in the future, and browsers may require more decimal places to
ensure higher-precision results. Also, some people have noted slight changes
inlayoutwhenremovingdecimal places.It'slikely,however,thattheonlyreal
drawback to using this many decimal places is the fact that it makes the CSS
less readable at a glance. But we'll put up with this for the purpose of ensuring
that our layouts are as future-proof as possible.
Let's continue changing pixel values to percentages. First, the right margin on the <nav>
element, which was 177px:
nav {
float: right;
margin-right: 17.35294117647059%;
padding-top: 20px;
}
Next, the width and right values for the .promo-desc element:
.promo-desc {
position: absolute;
bottom: 93px;
right: 7.35294117647059%;
width: 30.98039215686275%;
text-align: center;
}
The width value for the promo button (which is relative to the width of the .promo-desc
element):
.promo-btn {
display: inline-block;
Search WWH ::




Custom Search