Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
logo image replacement not working
has anyone else had this problem? i’m trying out the technique as shown here
what happens is it looks fine with the web developer toolbar turned on and editing CSS, and then when i flip it off the logo image disappears.
in the main document i have:
<div id="logo">
<h1>Site Title</h1>
</div>
logo h1 {
display:block;
width:250px;
height:46px;
text-indent:-9009px;
background:transparent url(my-company.jpg) no-repeat 0 0;
}
Offline
#2 2008-11-10 20:49:15
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: logo image replacement not working
Check your logo id?
#logo h1 {
display:block;
width:250px;
height:46px;
text-indent:-9009px;
background:transparent url(my-company.jpg) no-repeat 0 0;
}
Offline
Re: logo image replacement not working
well my div id is “logo”, and i used “logo h1” in the css. i’m not sure what to check hehe
Offline
Re: logo image replacement not working
rsilleti is pointing you to add the #
before logo
, on your CSS.
Offline
Re: logo image replacement not working
oh sorry, yeah that was in the css, just not pasted over in this thread. my mistake there.
Offline
Re: logo image replacement not working
Is the path to the image the correct one? (you should use an absolute path)
Offline
#7 2008-11-10 22:09:44
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: logo image replacement not working
Have you tried changing the path to your image? Maybe you need something like /my-company.jpg
or ../my-company.jpg
.
edit: late again… ;)
Last edited by els (2008-11-10 22:10:13)
Offline
Re: logo image replacement not working
but if the path is wrong, doesn’t that mean the web developer toolbar won’t be able to display the image?
Offline
Re: logo image replacement not working
mrtunes, is your page online?
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
Re: logo image replacement not working
maniqui wrote:
Is the path to the image the correct one? (you should use an absolute path)
do you mean it’s better to put the url as http://mysite.com/mypic.jpg rather than something like image\mypic.jpg ? i will admit i have always found this part confusing.
kemie: no my site is being done locally in xampp unfortunately, but if the problem persists a lot longer i will go live with it without the h1 title tag and fix it once it’s live.
Offline
Re: logo image replacement not working
mrtunes wrote:
maniqui wrote: Is the path to the image the correct one? (you should use an absolute path)
do you mean it’s better to put the url as http://mysite.com/mypic.jpg rather than something like image\mypic.jpg ? i will admit i have always found this part confusing.
Absolute links (beginning http://…) are the surefire way to ensure you link to the image but the disadvantage is that you will need to update the link when you transfer from home webserver to your online version. If you link to the file directly from within a txp page, you can use <txp:site_url />
to avoid this but for css this is not possible.
In such cases a relative url (of the kind “image/mypic.jpg” or “../image/mypic.jpg”) is better. You can use the network pane of firefox’s firebug plug-in or the safari developer tool to find out why an image is not being found.
TXP Builders – finely-crafted code, design and txp
Offline
Re: logo image replacement not working
jakob wrote:
If you link to the file directly from within a txp page, you can use
<txp:site_url />
to avoid this but for css this is not possible.
… unless you use smd_style to display your (database-held, not ‘real’) stylesheets, in which case you can choose to parse tags inside them ;-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline