 |
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

April 14th, 2007, 09:18 PM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Creating a "Frame" type page
I have created a "Frame" type page using a table. I have NOT been able to figure out how to "click" on an item in the "Sidebar" window and have something displayed in the "Content" window.
Can someone show me how to do this, or show where I might find an example of what I am trying to do?
Thanks....
Bruce
|

April 14th, 2007, 09:37 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Can you show us what you are trying to do, because it isn't all that clear. Do you use frames or not? Do you want to open another page inside a table? If that's it, you can't. Use frames or iframe if you must.
--
http://yupapa.com
|

April 14th, 2007, 09:55 PM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm a "newbie" so I'm not sure what I am doing. This is learn experience for me.
What I have created is a "table" of two rows and two columns. The top row I have used for a title and merged the cells. In the second row, I have designated column 2 as the "Content" area where I was hoping to display the items listed in the "Sidebar." The "Sidebar" is column 1 of the second row. In this cell, I have created another table, 1 column by "N" rows where a row is intended to hold a navigation item.
Now, as I research how to do this, I have NOT seen another example using tables, so I assume I'm "Doing it wrong!!" All of the example I could find used a "<div>" tag. I didn't understand what they were doing.
So can someone give me an example using CSS to create what I am trying to do.
Hope this helps.. If not, let me know, and thanks for the help..
Bruce
|

April 14th, 2007, 10:24 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
OK. The question is, do you want to display another PAGE in this "frame" of yours? Or do you just want content that has previously been hidden but is on the same page to appear?
The first you can't do without frames. You'd have to put an iframe in your table and show the pages in the iframe. The second technique uses CSS (and probably JavaScript) to show and hide sections of the same page. Not newbie stuff, really.
A third method that's guaranteed to be easier to implement, to load faster and be more accessible to both people and search engines is to create a bunch of almost identical pages (the same layout, menus and so on). The only difference being the content. Then you link to them in the menu. Since the layout is the same and images are cached the pages will load fast and it will look like only the content changes. This is the by far most userfriendly method.
--
http://yupapa.com
|

April 14th, 2007, 10:51 PM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes, I want to display pages in my "Content" area, such as pages to input data, display results retrieved from a database, i.e. the "Content" area is not to display static data.
I think I understand you "Third Method." With this method, I should be able to use CSS to assist in creating a template for these identical pages.
Thanks.
Bruce
|

April 15th, 2007, 10:31 AM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay. I've created the Template page with a Header, Content section, and a Sidebar for navigation. I used Dick York's CSS instantresults, chapter 2, Multi-column layouts as a model.
My next problem is how do include the "Navigation" stuff in my CSS file. I currently have it "Hardcoded" in the sidebar column as:
<div id="first-column">
[list]
<li><a href="index.php">Home</a></li>
<li>
<a href="appointment.php">Add an appointment</a> </li>
</ul>
</div>
As you can see, I currently have prototyped two link pages. My design has about 10 pages which I could handle by including all 10 pages in the template sidebar, then saving the template page 10 times, with the correct page name, of course. The problem comes about when I want to add an 11th or 12th page. I'll have to edit all 10 of the previous pages. Not good.
Can I include the above navigation code in my css file and just make a single reference to it in the template, i.e. a class or something?
Thanks....
|

April 15th, 2007, 04:40 PM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay.. I think I've solved the sidebar navigation problem mentioned in the above forum note by using php. In the sidebar, I have
<?php include('sidebar.php'); ?>
sidebar.php contains the navigation items. I just insert this line in each separate file.
I would STILL like to know if there is a way to solve the problem with CSS. Any suggestions?
Thanks...
|

April 16th, 2007, 01:34 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You can't. There is no CSS in this:
<div id="first-column">
[list]
<li><a href="index.php">Home</a></li>
<li>
<a href="appointment.php">Add an appointment</a> </li>
</ul>
</div>
CSS has nothing to do with content, so you can't move this code into a CSS file.
This is just plain HTML that should be put in HTML or server side scripting pages. As you found out, a server side include is the best way to reuse that content...
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|
 |