vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   CSS question regarding VB (https://vborg.vbsupport.ru/showthread.php?t=274423)

2fast4ya 11-22-2011 12:09 AM

CSS question regarding VB
 
I have been working on the stylevars in a new vb color scheme I'm working on.. I would like to add something to the top of my forums... a black bar that will hold a menu in it... If you go to http://www.eightysixed.com - the menu at the top that says "HOME" and "CLOTHING" is the menu I am trying to re-create.

I can recreate this using CSS in the additional.css template - but I'm lost on where exactly to place the code in order to make it appear. my forums are at http://www.audioneeds.com/forums/forum.php

Any help would be GREATLY appreciated

nerbert 11-22-2011 12:24 AM

Either put it in additional.css or if you make your own css file place this in the html

<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}mystyle.css" />

2fast4ya 11-22-2011 01:56 AM

Thank you nerbert, but which HTML file or TEMPLATE would I place the code in order to bring the CSS and links in the menu...? I explained where I wanted the menu in my first post, so just wondering which template that's in.

nerbert 11-22-2011 02:00 AM

If you put the HTML at the top of the header it should show on every page.

2fast4ya 11-22-2011 02:16 AM

Nerbert, that worked! But here is my problem. I created a DIV with a white background and placed it at the top of the header, and sure enough it showed... BUT the new div with the white background has the same WIDTH as my entire forum (960px) - but I want that background to stretch across the entire top of the page.. just like that Eighty Sixed website I posted.

nerbert 11-22-2011 02:38 AM

Then I think you will have to go to each page template and put a div above {vb:raw header}. Most (but not all) page templates are in all caps

2fast4ya 11-22-2011 03:09 AM

Okay, I tried that on the FORUMHOME template, and still the same width as the forum... not going all the way accross

nerbert 11-22-2011 03:22 AM

Try putting style="margin:0px -10px 0px -10px;" in your div tag and see if that makes it wider. The ten pixels is just a guess, if that works then either tinker around with different values or see if you can find the padding property for the body tag.

If it works you could probably put your div back in header and save having to edit all your page templates.

2fast4ya 11-22-2011 03:43 AM

Okay that is doing it! Awesome! Now the only thing is, how do I get it to touch the browser window on both sides? It's allowing me to define the size via pixels, but I need it to go all the way through from one side of the browser to the other

nerbert 11-22-2011 04:02 AM

I think the 2nd and 4th values (right and left, respectively) should be the same as the corresponding values of body padding, but negative.

StyleVars > Common > body_padding

The default value is 20px

2fast4ya 11-22-2011 04:12 AM

That's not quite doing it... I think normally if I would set the width to 100%, it should work, but it's not... Here is a link to what it looks like - It's the WHITE box at the top that says TEST - I want that white box to extend from one edge of the browser to the other... Normally width: 100% should do that... i dont get it.

http://www.audioneeds.com/forums/content.php?styleid=10

nerbert 11-22-2011 04:19 AM

Just add a few more (negative) pixels to the left and right values until you get it just right. You have to have a negative left margin or it will start above the left edge of the header.

2fast4ya 11-22-2011 04:22 AM

Yeah, but that will not compensate for different browser sizes.. This should adjust with the browser size the same way the Width:100% would... I'm not sure this should go in the header template...

nerbert 11-22-2011 04:33 AM

It will adjust automatically with the window size. Just use trial and error with those negative margin values until you get it all the way to the edge. You won't blow anything up.

2fast4ya 11-22-2011 04:48 AM

If i make it too large, a scroll bar appears at the bottom of the screen... or if you adjust the window size, and make the window smaller, the scroll bar is there...

I think it has something to do with the doc_width being at 960px. Since the doc_width is making the entire site 960px width... this div element that we're trying to make width 100% - its nto allowing it... I could be wrong, but that's what I'm thinking.

--------------- Added [DATE]1321944028[/DATE] at [TIME]1321944028[/TIME] ---------------

Okay, I finally figured this out after ridiculous amounts of trial and error. Going to explain it incase someone else ever tries to do the same thing and can't figure it out... It's actually so damn simple, I'm upset I struggled with it for so long.

You need to go into the header template and before ANYTHING else, enter your div info with the position at absolute, and the width at 100%

<div style="position:absolute; top:0px; left:0px; width:100%;">[DIV CONTENTS GO HERE]</div>

For some reason when i add this in the additional.css file, it doesnt work.

nerbert 11-22-2011 07:15 AM

If you make those negative margins too large you get the scrollbar, too little it doesn't span the whole way. That's why I suggested trial and error until it's just right. -25px would be close, maybe 24 or 26.

<div class="topdiv"> ....... </div>

In additional.css:

.topdiv {
margin:0px -25px 0px -25px;
}

But like I said, experiment with that margin figure.


All times are GMT. The time now is 07:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01017 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete