Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is It Possible to Align Contents in a Frame?

Status
Not open for further replies.

tyhand

Programmer
Jul 3, 2002
186
US
Hey all,

What I'm trying to do is get the an image that is located in a frameset on the bottom half of a page to align with an image on the top half.

Just follow me here a sec...

I have 2 Framesets - one on top and one on bottom of a web page (the 2nd is embedded in the 1st one). The top frameset has a header image that is centered. The bottom frameset is divided into 2 columns -- on the left is a navigation bar and on the right is where the content appears.

Ok - simple enough? Here's the code:

(frameset rows="145,*" cols="*")
(rame name="topframe" src="mysite.com/top_frame.html" scrolling="no")
(frameset cols="20%,*" rows="*" bordercolor="#cc0000")
(frame name="navframe" src="mysite.com/nav_frame.html" scrolling="no")
(frame name="contentframe" src="mysite.com/content.html" scrolling="yes")
(/frameset)

Anyway, I'd like for the contents that are located in the navigation frame (the "nav_frame.html") to align themselves more to the center of the image in the top frame (the "top_frame.html") REGARDLESS of how wide the screen resolution gets.

I've tried playing around with the "COLS" and "ROWS" attributes and have set them to different percentages but when I view the result in a browser the contents in the "nav_frame.html" appear all the way flushed to the left. I've also tried center aligning the contents of the "nav_frame.html" itself, but still no cigar.

Anyone have any ideas on how to accomplish what I want?

All tips welcome!

Peace!
- T Y H A N D
 
I don't think I follow. If your top frame stretches the entire browser window and the bottom two frames are split between two columns, then the only way to align anything would be to position everything with fixed values.

Do you really need to use frames for this? It is such an outdated method of building websites.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
tyhand said:
Anyway, I'd like for the contents that are located in the navigation frame (the "nav_frame.html") to align themselves more to the center of the image in the top frame (the "top_frame.html") REGARDLESS of how wide the screen resolution gets.

That's going to be pretty much impossible if the image in your top frame is centered. At some point the browser could be wide enough so that the image is only over the content frame.

(If your top frame image is left aligned, then you likely wouldn't even be asking this question, as you could simply put a margin-left on the nav frame.)

I have to agree with Vragabond - frames are rarely (if ever) the way to go.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Hey Fellas,

Thanks for the tip. I know frames are not really the way to go, but I was doing this as a favor to a family member who just insists on the Frame thingy.

Anyway, I pretty much figured it wasn't going to work - so I guess I'll move to plan "B".

Thanks again.

Peace!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top