Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: HTML question

24 Dec 2012   #1
Frank1

Desk Top with Win 7 Home Premium 64 bit and Lap Top with Windows 8.1 Pro 64 bit
 
 
HTML question

I have a web page that I made some time ago using HTML 4.1. My page covers the entire width of the screen. On a lot of web sites I see now the page does not cover the entire width, and there is a small margin on either side with usually a light or no color. I like it that way. Does anyone know what code or tag I would use if I wanted to change my page so that there is about a 10 or 15% margin on either side of the page?
My System SpecsSystem Spec
24 Dec 2012   #2
z3r010

 

It all depends on how the page is coded, is most cases you could probably get away with adding an inline style to the opening body tag with the % of width you want and auto margin to center.

HTML Code:
<body style="width:95%;margin:auto;">
My System SpecsSystem Spec
24 Dec 2012   #3
Frank1

Desk Top with Win 7 Home Premium 64 bit and Lap Top with Windows 8.1 Pro 64 bit
 
 

Quote   Quote: Originally Posted by z3r010 View Post
It all depends on how the page is coded, is most cases you could probably get away with adding an inline style to the opening body tag with the % of width you want and auto margin to center.

HTML Code:
<body style="width:95%;margin:auto;">
Thank you that did what I wanted to do. I enclosed it within my body tag as such:<body bgcolor="#ffffef" style="width:75%;margin:auto"> Now do you mind if I ask you one more question? The total page is all one color which is "#ffffef". Is there a way I can make the color of the margin different? If this answer will take too much detail to answer, that's OK if you don't answer. Thank you.
My System SpecsSystem Spec
.

24 Dec 2012   #4
z3r010

 

Not as simply as you did that, possibly you could leave the body at 100% then straight after the <body> tag have a <div style="width:95%;margin:auto;background: #000080;">

Then add a closing </div> before the </body> tag.

example
HTML Code:
<body style="background-color:#cccccc;">
<div style="background-color:#ffffff;width:95%; margin:auto">

Your content here

</div>
</body>
My System SpecsSystem Spec
24 Dec 2012   #5
Frank1

Desk Top with Win 7 Home Premium 64 bit and Lap Top with Windows 8.1 Pro 64 bit
 
 

Thank you. That worked.
My System SpecsSystem Spec
Reply

Thread Tools


Similar help and support threads
Thread Forum
Anyone know anything about HTML and CSS.
Hey everyone, I'm having a bit of trouble with a webpage that I'm working on. When viewed in either Chrome or Firefox it loads correctly but when viewed in IE it adds a thin white line at the bottom of the page and therefore adds a scroll bar. I'm fairly new to all this and so far have just been...
Chillout Room
Question on HTML codes
I'm studying HTML with an online tutorial. I use notepad to write the documents. I am now reading about using code for special characters such as: For the dollar sign you should use &#36; and there are other different codes for the double quotation mark and so forth. However if I simply put in the...
General Discussion
An HTML & CSS question
Hello guys, I am looking to make my website a modern looking one. I would like to put the table of contents on the top of my website, like that guy did on his one - Home Page The point is, when someone click on someone's profile, the webpage must open in the same window, not in a different...
Chillout Room
HTML question
I am taking an on line HTML tutorial. On my web page that I am making, I am trying to center a graphic. I'm getting it done, but not in the way that I should do it according to the tutorial. Of course, it's possible that I'm am misunderstanding the lesson. According to the instructions, if I want...
Browsers & Mail
html 5
hi all just want to know how you could see if your browser uses html 5 ?? thanks saakeman
Browsers & Mail


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:18.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App