Re: Renovating My Site (Two new Q! LAST DAY)

Working on a new template and need help? Come here for support.

Moderator: Help Desk Team

Re: Renovating My Site (Two new Q! LAST DAY)

Postby kuroi_hitsuji » August 7th, 2012, 10:56 pm

Q1: I want to center my layout
Spoiler! :
See when we layout it automatically centers our layout.

My banner, menu, and content are all in one column, and centered. Click the kuroi-hitsuji webcomic below to see what I mean.

I was wondering if there was a way to keep everything centered, but have a menu protrude on the left?
I think this comic did it somewhat:
http://devilscake.smackjeeves.com/comics/

The only thing is that it's not really centered, it's really on the left, save a little space. X) ;;


Here's an image of what I kinda wanna do.

Image
BLack: frame.
Green: banner
Blue: menu
Red: Content


QUESTION 2: making right fixed div attach
Spoiler! :
EDIT: THanks everyone who helped, so far! The above problem was solved...but...

I've been trying to mess around with the HTML, as expected with the tips it wasn't hard to fiddle... and it's working fine, except when I tried using "position: fixed" on the left, it did a good effect, but I can't do it with the right.

I thought about it and it might be a better place to put my ads, especially if it's fixed like the menu so it's always visible. Or I might put other buttons there, so it's not so cluttered....but...D: Anyway

Code: Select all
#Body {
       width:1220px;
       margin: auto;
       align: center
       position: relative;
    }
#Menu {
       position: fixed;
       width: 160px;
       top: 20px;
       text-align: center;
    }
#Main {
       position: absolute
       width: 900px;
       top: 0px;
       text-align: center;
    }
#Right {
       position: fixed;
       width: 160px;
       top: 20px;
       text-align: center; 
       overflow:hidden;
    }
</style></head>


I don't wanna use "right: <value>px" because I want it to be adjustable no matter the screen resolution, or even if they adjust the resolution/zoom of their browser.

Is this possible?

I've been going around sites for a few days and I'm...pretty lost.


THIRD QUESTION:

I'm just editing this cuz I feel bad if I spam this place with topics. When I'm done, I'll rename the topic to "Layouting woes" so people can browse this without being too mislead.

I'm applying a lot of CSS, since I'm trying to be more specific, and to clean up my site of random things I was forced to use before.

I was wondering, I'm using this CSS on only "Overall Layout" so far, but when it comes to other pages, like say the comics page, I want to make some additional codes in CSS.
I don't know CSS well enough (or how SJ works layouts well enough) to know if that'll mess it up.

Am I forced to dump all of my CSS coding into the overall layout, even if they're only for few selected pages?

I'm talking about the stuff under <head><style type="text/css"></style></head>
Last edited by kuroi_hitsuji on September 9th, 2012, 11:08 pm, edited 6 times in total.
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: Centering content, with the menu on the left?

Postby eishiya » August 8th, 2012, 8:04 am

Yes, there's a way to do it. I'd rather not go into the details of applying it to your own comic, but I'll give you the theory.

First, the Devil's Cake comic isn't centred at all, it just sits a fixed distance from the left. Not what you want, from the sound of it.

If I'm understanding you right, you want the layout centred as if the menu wasn't there, but have the menu protrude, right? I figure if you wanted the menu to be taken account into centring, you wouldn't ask...
The way I do it is give the layout a container that's as wide as the layout you have so far plus twice the size of the menu, and split it into three Divs: menu, content, empty right side. In other words, a structure like this:

Code: Select all
<div id="wrap">
   <div id="colwrap">
      <div id="left">
         {MENU}
      </div>
      <div id="main">
         most of your current layout would go in here
      </div>
      <div id="right">
         Emptiness.
      </div>
   </div>
</div>

To get these inner divs to align horizontally, you'd need to float them as you would in any three-column layout. CSS code:
Code: Select all
#wrap {
   width:1020px; //right + main + left widths
   margin:0 auto; //makes the layout butt against the top of the page (and bottom, if long enough), centres it horizontally
}
#colwrap {
   position: relative;
}
#left {
   float: left;
   width: 160px; //width of the menu container, whatever you want. Make sure the right container's width also matches.
   text-align: center; //optional, depends on how you format your menu
}
#right {
   float: left;
   width: 160px; //same width as the left
   text-align: center; // this line and
   overflow:hidden; //this line aren't really needed, useful if you want to put something in the right column

}
#main {
   float: left;
   width: 700px; //width of your main section, whatever you already have
   position: relative;
}


The problem with this is that the empty column still counts towards the total width of the layout, so when viewed in a smaller window, people will be able to scroll into the empty space.

If you want to see how this works in practice... well, one of my layouts is structured that way, but I ended up putting advertising and a chatbox in the empty column. Still, if you pretend they're not there (or hide them with Firebug or something), you can see how it works: http://blackdram.smackjeeves.com/
You can also try looking at the HTML and CSS I have for that site to see how it's done in practice. I highly recommend using something like Firebug or at least the DOM Inspector (both are Firefox plugins) when analyzing other sites' structure and CSS.
Busy, busy.
User avatar
eishiya
 
Posts: 5757
Joined: December 5th, 2009, 11:17 am

Re: Centering content, with the menu on the left?

Postby kuroi_hitsuji » August 8th, 2012, 12:53 pm

THANK YOU. Actually I considered that for a moment, and it seems the only possible choice, so far. :<

I've been researching on div positions so it was really easy to understand what you're asking me to do. Thank you :3


EDIT:

I'd still love to hear other options though.
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: Centering content, with the menu on the left?

Postby Asj » August 8th, 2012, 1:13 pm

It might work to center the whole thing. The main part by itself would be off center because of the menu, then, though.
Or what about something about floating the menu, or absolute/relative positioning it or something?

edit: I think I got something like that by having the menu and the main section in an outer div that's the width of both of them combined. Then, floating the menu left and the main section right. Then relatively positioning both of them and moving them to the left by half the menu's size - or just doing it to the outer div instead (this is done to center the main section). But, when I resize the window, it cuts off part of the menu because of pushing it to the left.
Image
User avatar
Asj
 
Posts: 944
Joined: January 4th, 2009, 5:42 pm

Re: Centering content, with the menu on the left?

Postby eishiya » August 8th, 2012, 2:04 pm

I think theoretically you can do it without that empty column. For example, something similar to what is explained in this link: http://www.webmasterworld.com/forum83/1630.htm
Busy, busy.
User avatar
eishiya
 
Posts: 5757
Joined: December 5th, 2009, 11:17 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby kuroi_hitsuji » August 10th, 2012, 2:54 pm

New problem, freh >_<
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby Asj » August 10th, 2012, 4:18 pm

would a percentage work?
I'm not exactly sure what you're asking.
Image
User avatar
Asj
 
Posts: 944
Joined: January 4th, 2009, 5:42 pm

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby kuroi_hitsuji » August 10th, 2012, 11:28 pm

Naw, I tried the percentages, but it aint working.

The code I used is only good for floats and position:relatives.

Absolute and fixed disregard parent divs so I was wondering how I could get it to stay there :|
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby eishiya » August 11th, 2012, 7:32 am

I'm also confused as to what you're trying to achieve. You say you want the right like the left, but you haven't actually shown us what the left looks like in action xP

If you're looking to vertically fix your ad: Why? A menu deserves to be fixed, an ad does not. Making it so that your users always see the ad just makes you look desperate for money because it draws attention away from the rest of the site.
Busy, busy.
User avatar
eishiya
 
Posts: 5757
Joined: December 5th, 2009, 11:17 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby kuroi_hitsuji » August 11th, 2012, 12:07 pm

eishiya wrote:I'm also confused as to what you're trying to achieve. You say you want the right like the left, but you haven't actually shown us what the left looks like in action xP

If you're looking to vertically fix your ad: Why? A menu deserves to be fixed, an ad does not. Making it so that your users always see the ad just makes you look desperate for money because it draws attention away from the rest of the site.


I guess so, but I just wanted to put the ad fixed, cuz it might balance it out better. As I said, I might put buttons there instead. I'm just exploring my options, since... my images are very low res in my original site layout and I didn't really have the patience or time to explore HTML when I made it(I just wanted to start my comic. XD)...yeah. Meh.

Less is more but what I like to do is build everything possible then tear down what I don't like.

I guess I should try something else, but I do definitely want the option to put something there.

Oh and lol sorry I forgot to show what it looked like in action.
Don't mind the derpness of the images, I'm only using random boxes of stuff and trial images, they're not rendered at all, and those aren't the images and exact proportions, I'm just trying to layout this in code first. >.<;;

http://kuroi-hitsuji.smackjeeves.com/test/
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby eishiya » August 11th, 2012, 12:32 pm

Sadly, with HTML it's often easier to just get what you need, because the extra stuff will take 10 extra years to work out. And don't forget cross-browser compatibility D8

I'm not sure how to help you with positioning the Box O Shit since I don't know what you want, but one quick fix to keep it from overlapping your content is to assign the main div and Box O Shit div z-values that put the Box O Shit on the bottom. Obviously that's just a duct-tape measure and not a proper remedy to the problem, but it's something.

Sorry I'm not much help ): I know this can be done with JavaScript (querying the display size and setting the element position according to that), but I'm really hoping it can be done with just CSS too.
Busy, busy.
User avatar
eishiya
 
Posts: 5757
Joined: December 5th, 2009, 11:17 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby kuroi_hitsuji » August 11th, 2012, 1:29 pm

Ahaha okay time to scrap this idea I guess. :| NEW PLAN. XD
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Re: NEW PROB (view edit in 1st post) Fixed Div Right of Content?

Postby Asj » August 12th, 2012, 7:36 am

What I saw, it looked like it needed a "display: inline" for the three boxes.
Image
User avatar
Asj
 
Posts: 944
Joined: January 4th, 2009, 5:42 pm

Re: 3rd Q: can you use CSS on Overall Layout AND other pages?

Postby Ddraigeneth » August 16th, 2012, 11:11 am

3rd Q: can you use CSS on Overall Layout AND other pages?

I'm assuming this is a new question, and yes you can. Just make sure to put it in the <style> tags just like on the Overall page. You can also put CSS in individual elements, such as <div style="background:url(link) repeat; font-size:2em; margin:20px"> etc.
User avatar
Ddraigeneth
 
Posts: 4065
Joined: June 26th, 2010, 12:06 pm
Location: 6 inches to the right

Renovating My Site (No New Questions. Temp closed)

Postby kuroi_hitsuji » August 17th, 2012, 11:34 am

THank you! I see. I will temporarily close all questions.

Please dont delete this since I'm still in the process of making my site, so I may come back and forth. -u-;
Image
User avatar
kuroi_hitsuji
 
Posts: 140
Joined: March 27th, 2008, 2:40 am

Next

Return to Template Development & Support

Who is online

Users browsing this forum: No registered users and 0 guests