plus-minus image alignment issues

plus-minus image alignment issues was created by muesliflyer

Posted 10 years 9 months ago #12450
Hi Cedric,

many kudos for providing this nice module.

I was running in some formatting issues when eventtarget = image.
  1. In that case you are using and img tag with align=right/left to create the plus or minus sign. Out of the box the positioning of the signs is not ideal. They stick to the top of the menu item and are not nicely centered in line with the menu text. (It does work nicely if eventtarget=link).
  2. The cursor on the image should be the pointer.
  3. Aligning an img left or right makes it float to that place and any padding of an adjacent anchor overlaps with the floated img. If the padding is too small, this can lead to the menu text to touch the img.
To solve the issue, I made the following hacks:
Code:
img.toggler { cursor: pointer; padding-top: 6px; /* kludge to get it better vertically centered. */ } <?php echo $id; ?> li a { padding-right: 20px; ... }
But this only works when the img is aligned right. You may want to find a better solution that works more generally and with different img sizes (mine is 16x16px). A better solution might be to make the img display in line with vertical-align=middle. But I didn't test it.

I also noticed, that when you align the image left and have (outside) bullets on your menu items, the img is placed between the bullet and the text, which looks a bit strange.

Here you can see what it looks like with my hack.

Cordialement.
muesliflyer

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic plus-minus image alignment issues

Posted 10 years 9 months ago #12451
Hi
have you tried to add a display:block like this :
Code:
<?php echo $id; ?> li a { display:block;

else give me your url
CEd

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Replied by muesliflyer on topic plus-minus image alignment issues

Posted 10 years 9 months ago #12457

ced1870 wrote: Hi
have you tried to add a display:block like this :

Code:
<?php echo $id; ?> li a { display:block;

It was already a block. To get a margin between a block and a float, the float must have a margin/padding - the block's margin is ignored here. So, a partial solution would be to add a left margin/padding to the img (if it is align=right). However this doesn't solve the vertical positioning issue for the img. Inline-blocks might be a solution if we don't want to use tables.

else give me your url
CEd

See the last sentence in my previous post. ;)

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic plus-minus image alignment issues

Posted 10 years 9 months ago #12458
ok I have seen the "here" in your post ;)
I see that is renders correctly. I will try to improve my themes in the future :)
CEd

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Time to create page: 0.695 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 339 guests and no members online