How do I make span class text vanish when CSS is applied.

This is a discussion on "How do I make span class text vanish when CSS is applied." within the Web Page Design section. This forum, and the thread "How do I make span class text vanish when CSS is applied. are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 2nd, 2007, 15:41
Junior Member
Join Date: Jan 2007
Location: UK
Age: 23
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
How do I make span class text vanish when CSS is applied.

How can I do it so that when I apply the style sheet, the header that is present should styles be switched off, is replaced with an image? (in this case the logo).

I've managed to write the CSS so that the image is applied but my H1 text is still visible over the top.



This is the HTML:

Code: Select all
<h1><span class="textHide">Bridge Garage - Specialist Cars</span></h1>
And this is the CSS:

Code: Select all
#Header H1 {
    position: relative;
    margin: 0;
    padding: 0;
    background-image: url('images/bridge_logo.gif');
    background-repeat: no repeat;
    left: 22px;
    width: 247px;
    height: 82px;
}
Have I made a mistake somewhere and am just not seeing it?

Last edited by Inkers; Nov 2nd, 2007 at 15:41. Reason: Title edit
Reply With Quote

  #2 (permalink)  
Old Nov 2nd, 2007, 15:54
mcdanielnc89's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Missouri
Age: 19
Posts: 232
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

i think it would go like this.

HTML:
HTML: Select all
<div id=header>
<p class="h1"><span class="textHide">Bridge Garage - Specialist Cars</span></p>
</div>
And your CSS would be.

HTML: Select all
#header .h1 {
    position: relative;
    margin: 0;
    padding: 0;
    background-image: url('images/bridge_logo.gif');
    background-repeat: no repeat;
    left: 22px;
    width: 247px;
    height: 82px;
}
I hope and pray this works, lol.
Last Blog Entry: My blog? (Oct 18th, 2007)
Reply With Quote
  #3 (permalink)  
Old Nov 2nd, 2007, 15:59
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 422
Blog Entries: 2
Thanks: 6
Thanked 4 Times in 4 Posts
Re: How do I make span class text vanish when CSS is applied.

I really dont understand what u want to do !? please describe more in details
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #4 (permalink)  
Old Nov 2nd, 2007, 16:07
Junior Member
Join Date: Jan 2007
Location: UK
Age: 23
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

Quote:
Originally Posted by marSoul View Post
I really dont understand what u want to do !? please describe more in details


Basically that header you see over the text? I'm trying to set it up so that is ONLY visible should someone turn off the styling on say a handheld or if they just want basic HTML view and that when someone has the CSS enabled, that the logo is visible instead of the header.
Reply With Quote
  #5 (permalink)  
Old Nov 2nd, 2007, 16:09
Junior Member
Join Date: Jan 2007
Location: UK
Age: 23
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

Quote:
Originally Posted by mcdanielnc89 View Post
i think it would go like this.

HTML:
HTML: Select all
<div id=header>
<p class="h1"><span class="textHide">Bridge Garage - Specialist Cars</span></p>
</div>
And your CSS would be.

HTML: Select all
#header .h1 {
    position: relative;
    margin: 0;
    padding: 0;
    background-image: url('images/bridge_logo.gif');
    background-repeat: no repeat;
    left: 22px;
    width: 247px;
    height: 82px;
}
I hope and pray this works, lol.
Hmm.. that seems to have removed the logo and not the text...
Reply With Quote
  #6 (permalink)  
Old Nov 2nd, 2007, 16:09
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,661
Thanks: 0
Thanked 9 Times in 9 Posts
Re: How do I make span class text vanish when CSS is applied.

Could a different stylesheet be of any help? I too dont really understand what you want.

http://creativecoding.webforumz.com/...ircher-php.php
Reply With Quote
  #7 (permalink)  
Old Nov 2nd, 2007, 17:07
mcdanielnc89's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Missouri
Age: 19
Posts: 232
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

Quote:
Originally Posted by Inkers View Post
Hmm.. that seems to have removed the logo and not the text...
Why? I didn't change any of that, lol.. just added a div and class, lol...
Last Blog Entry: My blog? (Oct 18th, 2007)
Reply With Quote
  #8 (permalink)  
Old Nov 2nd, 2007, 17:58
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

display: none;
added to the h1 should do it.

Other folks prefer adding a -9999px to the text and scoot it over rather than try to hide it.
Reply With Quote
  #9 (permalink)  
Old Nov 2nd, 2007, 22:09
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How do I make span class text vanish when CSS is applied.

Quote:
Originally Posted by Marc View Post
Could a different stylesheet be of any help? I too dont really understand what you want.

http://creativecoding.webforumz.com/...ircher-php.php
What I think he means is that in firefox you can turn off the default stylesheet by clicking View > Page Style > No Style and instead of an image being displayed, he wants the H1 text.

Either that or he needs to create a stylesheet for mobile devices
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS not applied unless manually refreshed alowe Web Page Design 6 Apr 3rd, 2008 21:32
Can <span></span> tags have position relative? Oak Web Page Design 13 Mar 9th, 2008 17:04
<SPAN> help Access JavaScript Forum 2 Nov 3rd, 2007 18:13
Span questions maxelcat Web Page Design 2 Aug 7th, 2006 11:07
does anyone know how to make elements such as text boxes in benbacardi Web Page Design 4 Apr 4th, 2004 09:13


All times are GMT. The time now is 13:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43