News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Simple DIV question (image include)

Started by Biology Forums, August 10, 2011, 01:04:37 AM

Previous topic - Next topic

Biology Forums

The code below corresponds to the exact are I need help in.

<td valign="middle" width="100%" style="padding-left: 6px;" id="top_subject">
', $context['subject'], '<br /><small>(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ') |

', !empty($context['show_rate']) ? $txt['rate_average'] . ':</small> ' . ($context['can_moderate_forum'] ? '<a href="' . $scripturl . '?action=ratelog;id=' . $context['current_topic'] . '">' : '') . '<img src="' . $settings['default_images_url'] . '/dr' . $context['rating_average'] . '.png" alt="' . $context['rating_average'] . '" />' . ($context['can_moderate_forum'] ? '</a>' : '') : '', '
';

if(!empty($context['can_rate']))
echo '
<div class="smalltext" style="float:right;">
<form action="', $scripturl, '?action=rate" method="post" name="topicRating" accept-charset="', $context['character_set'], '">
', $context['can_rate'] == 1 ? $txt['rate_topicAgain'] : $txt['rate_topicNew'], '
<select name="rate">
<option value="">---</option>
<option value="1"', $context['user_rating'] == 1 ? 'selected="selected"' : '', '>1</option>
<option value="2"', $context['user_rating'] == 2 ? 'selected="selected"' : '', '>2</option>
<option value="3"', $context['user_rating'] == 3 ? 'selected="selected"' : '', '>3</option>
<option value="4"', $context['user_rating'] == 4 ? 'selected="selected"' : '', '>4</option>
<option value="5"', $context['user_rating'] == 5 ? 'selected="selected"' : '', '>5</option>
</select>
<input type="submit" name="rateTopic" value="', $txt['rate_topicGo'], '" />
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="board" value="', $context['current_board'], '" />
</form>
</div>';

echo'

</td>


I would like the rate topic DIV to be centered vertically in the middle. For some reason, I can't get it to go, anyone with experience?


Sir Osis of Liver


Did you try



<div class="smalltext" style="float:right; display:inline;">


When in Emor, do as the Snamors.
                              - D. Lister


Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister


Sir Osis of Liver

Have you tried putting margin-bottom: or padding-bottom: under it?

Attach your Display.template.php - I'll see if I can get enough of it to run to work on it.

When in Emor, do as the Snamors.
                              - D. Lister

Biology Forums

Okay this is what I ended up doing:

Put the other content within the TD in a div, made it flow to the left and I left the div surrounding the rate topic section as it is and gave it a 7px margin-top and it worked magically.


Sir Osis of Liver


Probably would have been easier just to put it in it's own <td>.  Nothing wrong with table formatting, but it's gone out of fashion and everything's css now.  Glad you got it right.

When in Emor, do as the Snamors.
                              - D. Lister

Sir Osis of Liver


Looks like guests don't see it.  Nice job on the logo.

When in Emor, do as the Snamors.
                              - D. Lister

Biology Forums

Quote from: Krash. on August 11, 2011, 01:39:24 AM

Looks like guests don't see it.  Nice job on the logo.

Thanks a lot. I know, the tables are driving me nuts, but what can I do, it's 1.x and the theme and built on the core theme. The header, however, is purely div, and it was actually easy to play around with and manipulate.

Advertisement: