0

I am trying to style a basic HTML form that uses an image background:

<form style="
    background:url(http://moneythink.org/wp-content/uploads/2012/06/Moneythink-Newsletter-Signup-Background.jpg) no-repeat; 
    padding:90px 0px 60px 122px;">
    <input type="email" value="Email" name="EMAIL" 
        class="required email" id="mce-EMAIL" 
        style="width: 100px;" style="padding-bottom: 5px;"> 
    <input type="image" src="http://moneythink.org/wp-content/uploads/2012/06/Submit-Button.jpg" 
        alt="Submit button" style=" padding-left: 57px; padding-bottom: -40px;" 
        name="subscribe" id="mc-embedded-subscribe">
</form> 

All is looking as expected, except, for some reason, I can't get the Submit button to appear directly underneath the text field; it keeps appearing next to it, on the right.

Any tips on how to fix this?

3 Answers 3

4

In the CSS, apply display: block to the submit button, or - if using floats for layout - clear: both.

This will render the button as a block level element in the flow, resulting in the desired layout.

Reference

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome, using display: block fixed it. Thanks much!
1

Use a stylesheet. Inline CSS will make your eyes bleed.

After you do this, making the buttons block-level elements might do the trick (depending on your desired layout):

form input[type="image"] {
  display: block;
}

Comments

0
<html>

<style>
--your style--  
</style>

<body>
<form>
 --your class-- 
</form>
</body>

</html>

like this(for shadow text php):

<?php

echo "<html>";
echo "<head>";

echo "<style>";

echo '.inner_text_shadow{text-shadow: 1px 1px white, -1px -1px #444;}';
echo '.default{font-size:30px;color: darkred;font-weight:bold;}';
echo '</style>';
echo '<body>   <p class="inner_text_shadow default">FreeClup Best Code</p></body>';
echo "</html>";
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.