vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Image link question (https://vborg.vbsupport.ru/showthread.php?t=221772)

Stormraven 08-26-2009 12:37 AM

Image link question
 
Im creating my own style and we coded it but for some reason vbulletin is playing up and I cant understand why, here is the css code for the main image.

Code:

#logo {
background: transparent url(images/misc/banner.png)top left no-repeat;
position: relative;
float: left;
height: 110;
}

and here is the other bit, the html div:

Code:

<div id="logo">
 <a href="/"></a>
</div>

for some reason that wouldnt work,, to get it to work we had to put the image code there again for some reason, like this:

Code:

<div id="logo">
 <a href="/"><img src="images/prowebforums/misc/banner.png" border="0" /></a>
</div>

I don't understand why we have to declare the main logo twice, its nothing big but I just want to understand why it's doing this.

tipoboy 08-26-2009 10:44 AM

http://jigsaw.w3.org/css-validator/

when you copy your css into the validator you get this error:

Quote:

In (x)HTML+CSS, floated elements need to have a width declared. Only elements with an intrinsic width (html, img, input, textarea, select, or object) are not affected
also using this:
Code:

<div id="logo">
 <a href="/"><img src="images/prowebforums/misc/banner.png" border="0" /></a>
</div>

you are placing the image as a clickable hyperlink image and not a background attribute like you were using this CSS:

Code:

#logo {
background: transparent url(images/misc/banner.png)top left no-repeat;
position: relative;
float: left;
height: 110;
}

Try using this code:

CSS:
Code:


#logo {
 background-image: url(images/misc/banner.png) top left no-repeat;
 float: left;
 position: relative;
 height: 110px;
 width: whatever size you wishpx;
}

also sometimes when adding additional CSS the background attribute needs a leading slash there for try this:

Code:

#logo {
 background-image: url(/images/misc/banner.png) top left no-repeat;
 float: left;
 position: relative;
 height: 110px;
 width: whatever width you wantpx;
}

let us know how you get on...


All times are GMT. The time now is 07:07 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.00940 seconds
  • Memory Usage 1,717KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_quote_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