General Community > Scripting Help

Span style issue

(1/2) > >>

Texan78:
Hello,

I am having a brain fart or something just isn't working right. I have redone my twitter login page and in the header I added a twitter icon next to the title. I am trying to center it in the div so it won't be at the top like it shows in the pic. I want to center it. I am using inline style because no since to have a div class for this one icon. I was able to create space between the icon and the text but I can't get it to center in the div. Any suggestions of what I could try? I have tried margin-top and padding-top and nothing changes it.


--- Code: --- <h3 class="catbg"><span style="padding-top: 5px; margin-right: 5px;"><img src="' . $default_theme_url . '/Themes/default/images/icons/1344236875_twitter.png" border="0"></span>'.$txt['twittmainlog'].'</h3>
--- End code ---

Now when I move the style for the padding-top inside the h3 element tag it moves it, but it also moves the text naturally as I knew it would. Did that to test it, but when I move it back into the span style it has no effect. Any ideas?

-Thanks

ElPlayer:
try adding margin-top to the img itself

Texan78:
Thanks for the response. That works as far as the image goes, but now it pushes the text down. I have tried it outside of the h3 tag and that only makes things worse and pushes the header text so far down it disappears. Not sure now have to bring the text up. I know why it's killing it, because the inline styles from the image are overheading the h3 class. Stuck and not sure of a way around it. I would hate to have to make a whole new class just for this one instance ya know? Any suggestions?


--- Code: ---<div class="cat_bar">
              <h3 class="catbg"><img style="padding-top:4px; padding-right:5px" src="' . $default_theme_url . '/Themes/default/images/icons/1344236875_twitter.png" border="0"/>'.$txt['twittmainlog'].'</h3>
   </div>'
--- End code ---

ElPlayer:
ohhh i forgot... smf already ve a class for that :l

just add
--- Code: --- class="icon"
--- End code ---
to the img


--- Code: ---<h3 class="catbg"><span class="floatleft"><img class="icon" src="' . $default_theme_url . '/Themes/default/images/icons/1344236875_twitter.png" border="0">'.$txt['twittmainlog'].'</span></h3>
--- End code ---

Texan78:

--- Quote from: ElPlayer on August 17, 2012, 06:59:30 PM ---ohhh i forgot... smf already ve a class for that :l
--- End quote ---

LoL yep! I made that last post then went out and smoked and thought about it. I went wait a minute. SMF has a class for that already because the information center has icons in the header. LoL

I came in and saw this post right after I remembered that, but you saved me the time have to go look for the class. Made the change and it works perfectly.

Thanks for your help!

Navigation

[0] Message Index

[#] Next page

Go to full version