little help

garryms

New Member
Messages
19
Reaction score
0
Points
0
I'm still in the process of my first website using Dreamweaver. I wanted that when I view it in a browser, it would automatically fit at the middle of the screen(it's on the left side as of now). How can I do that? Appreciate your input on this. Thanks...:)
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
Is there no option to center it in dreamweaver?
 

garryms

New Member
Messages
19
Reaction score
0
Points
0
yes. it's either absolute, relative, fixed or static positioning but i'm struggling... I wanted to be always in the center just like this forum page...
 

lukoot

New Member
Messages
120
Reaction score
2
Points
0
give this a try im sure i had the same problem some time ago and i think thats what i done

Put <center> directly under the <body> tag. Then, put </center> directly above the </body> tag.
 
Last edited:

garryms

New Member
Messages
19
Reaction score
0
Points
0
hi,
I did what you told me but it is still positioned in the left side of the screen...
thanks for your help...:)
 

lukoot

New Member
Messages
120
Reaction score
2
Points
0
hi
just to check you didn't do this ?
</center>
<body>
<center>
 

smithee

New Member
Messages
45
Reaction score
2
Points
0
Have you ever used DIVs? These allow you to divide your page with invisible boxes and you can style them to how you wish. So in your case, wrap the content with a DIV tag, and style its margin and width:

HTML:
<div style="width:200px; margin:auto;">
<p>Hello world.</p>
<p>Replace the content here as you wish. Notice that if the text is too big to fit on one line, it will automatically start a new one!</p>
</div>

Simple as! :)

You can even give it a "class", then it can be referred to separately. Dreamweaver lets you do that fairly easily. Try this:

  1. Highlight the page content you wish to be in the centre of the page
  2. Insert > Layout Objects > Div Tag
  3. Make sure "Wrap around selection" is selected, and click "New CSS Rule"
  4. Underneath "Choose a contextual selector type for your CSS rule", select "Class". Give it a name of "middle", and select "This document only". Click OK.
  5. Click on Box, then type in a width of your choice. In the Margin section, clear the "Same for all" check box, and select "auto" for left and right. Click on OK twice.

Have a look at the code it's produced and see if you can understand it. The advantage of using this method is that by simplying entering "middle" as a class for any div tag, it will be automatically assigned to the properties stated towards the top of the page.

One more thing... try to give a better subject for a thread. So instead of "little help", try "Centre section in Dreamweaver". That way, the right people will be able to look at just the title and know exactly what to do.
 

garryms

New Member
Messages
19
Reaction score
0
Points
0
I was able to fix it. I went over the book and just set the CSS Rule Positioning Type to Relative. It will now position the page at the center of the screen.

Lukoot: I put the right code, it did not solve the problem but it help me in other way.

Smithee: I'll take your advice. Next time I'll put a more descriptive subject.

Thanks for you help guys...:)
 
Top