Jump to content

Determining Page Size?


rhythm

Recommended Posts

New to HTML/CSS but learning fast (I hope!)Need to put up a "sales page" fast. You know, those ubiquitous one-page landers with a ridiculously long-scrolling sales pitch, and with a link at the bottom taking you the actual product & purchase pages. Typically, these pages all seem to have the same narrow width, about 7", or maybe it's just a 7" frame/table laid against a full-page-width background, I'm not sure.Anybody know the code for adjusting this width and where it appears in the full code?P.S. As an example, I tried to copy over the complete code from such a sales-page, into a text-editor and saved as an .html file. When I opened the file in a new browser window, all the text, formatting & colors were still the same, but the 7" width of the basic white background (with about 3" of a solid dark color on each side) had expanded out to about 11", only 1" of dark color on each side. Yet when I viewed both pages in source code, I could find no changes?

Link to comment
Share on other sites

Surround all the content in a <div> element and give it a fixed width. Don't use tables, they're much slower to render than <div> elements and take a lot more markup to write.Or better than that, give the <body> element a width, and put the background of the rest of the page on the <html> element.This is CSS:

html {  background-color: white;  text-align: center;}body {   background-color: blue;  margin: 0 auto;  text-align: left;  width: 760px;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...