CodingCSS help needed, please!

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Jo (JELLS)  
 To:  ALL
30114.1 
As i may have mentioned before, i've been asked to redo my employer's website using a template provided by "head office" - the Ministry of Foreign Affairs of Japan. My office is too cheap to hire professionals to do this and i'm entirely self-taught (emphasis being on teaching myself only the stuff i was interested in doing on my own site).

Anyway, things are going ok except for one weird problem i've encountered. They want little pdf icons next to links to pdf documents which is cool - i do that on my site no problem. On this website, it's a problem. It only positions the pdf icon properly if the link is part of a list, i.e. between <li tags. If it's in the middle of a paragraph, for example, it sticks the pdf icon out in the middle of nowhere.

Here is an example of it working properly (last two items on the list) and here is an example of it not doing what i want it to do at all (both the pdf icons and the "NEW!" icons).

I'm baffled. Does anyone have any ideas/suggestions? Please?

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  patch  
 To:  Jo (JELLS)     
30114.2 In reply to 30114.1 
On that second link, in the Remarks section of the Japanese Studies 2006 bit, it seems to work fine. The PDF icon is right next to the link.

0/0
 Reply   Quote More 

 From:  beseku  
 To:  Jo (JELLS)     
30114.3 In reply to 30114.1 

What browser you using?

 

If it is IE, try adding zoom:1* to whichever item you are adding the icon to.

 

* zoom:1 is the best way to unobtrusively turn on "hasLayout" which is the cause of, and solution to almost all of IE 6's layout bugs.

Ben.
-------------------------------
beseku.com
beyondstandards.com
flickrshow.com

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.4 In reply to 30114.1 
Your div#rightcontents p img class is being applied to it, and causing it to float right.
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  patch     
30114.5 In reply to 30114.2 

Yes, becauase it's in <li tags.

 

And it's not supposed to be - i did that to see if that made a difference.


Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  beseku     
30114.6 In reply to 30114.3 
I never use IE, but it doesn't work in any browser - IE, Opera, Firefox (what i use). I need it to work in all of them.

quote:
try adding zoom:1*


Adding it where? To the CSS? The HTML? Will that fix it in the better browsers too?

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.7 In reply to 30114.4 
Ah... so how do i fix that?

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.8 In reply to 30114.7 
I would probably change the declaration to something like this:
code:
div#rightcontents p img.r


And then set class="r" to any images you want on the right, and leave the rest as it is.
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.9 In reply to 30114.8 

Cool. I'll try that when i get back to my desk (covering for someone else at the moment).

 

Thank you!


Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.10 In reply to 30114.8 
That didn't work, unfortunately. Unless i've misunderstood what you suggested.

I added this to the CSS:

code:
#rightcontents p img.r {
	border:0px;
	padding: 2px 0 2px 0;
}


And added the class="r" to the image, but it won't budge. I'm testing this on a test page/css that i have on my own webspace simply because it takes eons to upload to the government's webspace.

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Matt  
 To:  Jo (JELLS)     
30114.11 In reply to 30114.10 

Have you made sure the CSS isn't be cached unnesessarily by the browser?

 

You probably have, but y'know just incase :)

 

Incidentally can anyone actually explain why it is that both IE and FireFox seem to completely ignore the last-modified headers send by web servers for .css files? They don't do it for any other file types (that might be a lie) so what makes .css files so special that you need to force refresh to see the changes?

doohicky

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.12 In reply to 30114.10 
You don't want to add that - you need to replace the previous one (the one without the .r)

Then, some images that should be right aligned might shift over to the left, and if that happens you need to add the class="r" to those images to put them back.
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.13 In reply to 30114.12 
ok... well, i had also tried deleting the other one:

code:
.image_right {
	margin-left:5px;
	float:right;
}


combined with adding this bit:

code:
#rightcontents p img.r {
	border:0px;
	padding: 2px 0 2px 0;
}


So you're saying that i should delete the first, and replace it with the second one? Or replace it with something else?

*is confused*

(sorry for being dense - didn't sleep well last night)

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Matt     
30114.14 In reply to 30114.11 
I've been force-refreshing it every time. I always do that.

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.15 In reply to 30114.13 
No problem - keep learning and soon you'll be able to do all this in your sleep. ;)

Ok, first step is to find the class that's called #rightcontents p img and put /* before it, and a */ after the closing curly bracket.
(that will deactivate it, without needing to physically remove it)

Then save the file, force refresh, and see what happens.

It will probably make all your images in the content bit inline (next to the text), which in most cases should be what you want.

If there are any images now appearing not how you want then we can go to the next step. :)
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.16 In reply to 30114.15 
I am either blind or else we're looking at two different CSS sheets... I don't see "#rightcontents p img"

I have this:

code:
#rightcontents p {
	margin-bottom:0.9em;
}

/*
.image_right {
	margin-left:5px;
	float:right;
}
*/

.image_left {
	margin-right:5px;
	float:left;
}


And you can see that i added the oblique-asterisk thing to the .image_right one. And uploaded it (to the proper webspace, not my testing area). And the pdf and other icons are still floating right...

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.17 In reply to 30114.16 
Hmmm, I found that reference by looking in the Firefox DOM inspector CSS thing.
I dunno if you have the developer stuff installed, but if you can find DOM Inspector in one of the menus (Tools, I think?)
then navigate to a right aligned image in the left part, and select CSS in the right part and see what it lists?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Jo (JELLS)     
30114.18 In reply to 30114.16 
Hmmm, workaround that should work, but not really the best way: add
code:
style="float:none;"
directly to the img tags for the pdf icons, and that should fix them.
But it's not an ideal solution-best to try and find the thing floating it right and fix that instead.
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.19 In reply to 30114.18 

Well, that one did work! The positioning isn't perfect, but that can be fixed. I do have that CSS toolbar installed but i think this will have to wait until tomorrow as i've been asked to take care of something else here at work.

 

Thank you for your patience - i will have a look at this again tomorrow and revive the thread as needed! :-)


Link to Canadian-Politics.com
0/0
 Reply   Quote More 

 From:  Jo (JELLS)  
 To:  Peter (BOUGHTONP)     
30114.20 In reply to 30114.18 
How does that DOM inspector thing work? I have been trying to use it but when i click on Dom Inspector (under Tools in the Web Developer toolbar), nothing happens. Is something supposed to open or show or something?

Link to Canadian-Politics.com
0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–29

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats