vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to: Auto Center your Header Logo (https://vborg.vbsupport.ru/showthread.php?t=317033)

Medi0cr3 01-30-2015 02:06 PM

How to: Auto Center your Header Logo
 
Greetings,

I've tried to google how you have your logo auto center across your header on the forum. There's a lot of people that have various ways. I do my own and many will have various ways to go about it. Here is the simple version.

Open your "Header" template.

Look for the last </script> tag in your code and insert after it:
Code:

<style>

#logo {
    display: block;
    margin-left: auto;
    margin-right: auto
}
</style>

Next you will need to look for this section of code which contains your header info
Code:

<div><a name="top" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}"
alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a></div>

I modified that a little bit to have the following. There are a few things that you can keep or get rid of if you wish. I chose to eliminate some things I really dont need as I customize my forum a lot.
Code:

<a href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}"><img id="logo" src="{vb:stylevar titleimage}"/></a>
You should now have a centered Logo Image on your forum header that scales centered as your screen size changes.

TRN 01-10-2017 01:46 PM

That's not working for me. I'm on 4.2.3PL2. Looks like the code is slightly different from your original one.

I modified my header to contain:
Code:

<vb:if condition="$stylevar['titleimage']"><div><a name="top" href="{vb:link forumhome}".php{vb:raw session.sessionurl_q}"><img id="logo"  src="/Forum2016/images/Header_logo.png" alt="The Real Nicaragua"/></a></div></vb:if>
Not sure if "logo" should match the image file name?

I'd like to have both the banner logo and the log-on navbar centered.


All times are GMT. The time now is 01:13 PM.

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.01057 seconds
  • Memory Usage 1,710KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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