Centering form on page - Post ID 215127

User 38401 Photo


Senior Advisor
10,951 posts

Per wrote:

with this one:

<div style="padding-top: 30px; padding-bottom: 0px; height: 559px; width: 99%; margin: 0px -13% 0px auto;">

This seems to work and the form looks nicely centered at all viewport widths. [/b]

You can play around with the parameters and alter the numerical values to your liking - if you so wish. The height in the original is continuously modified by the javascript, as the viewport is resized. I think you could remove the height declaration entirely, since the size of the form will determine the height of the div anyway.


Make sure to take all that style information there and put it into your own class in your CSS file rather than inline like that unless you already have a lot of inline styles in your page already. Yes inline styling works, but it's not the handiest way for editing in the long haul which is why CSS was born to begin with. For this, it is probably not detrimental that it's in the CSS since it's only used in one space in your entire site on one page, but overall your styles should go in a CSS file rather than in the HTML itself.
User 2500265 Photo


Registered User
10 posts

A coffeecuponion miracle just happened on marcsusan,com

See http://marcsusan.com/loginTEST.html

Thanks for your devotion to make this happen, you all.

And please drop by for some genever shots and new herring, whenever you visit The Hague.

Salud!

Marc
User 1948478 Photo


Senior Advisor
1,850 posts

Marc Susan wrote:
And please drop by for some genever shots and new herring, whenever you visit The Hague.

Genever and herring, - sounds great!
I'll take you up on that, Mark! Count on it! ;)
User 2500265 Photo


Registered User
10 posts

:D
User 1948478 Photo


Senior Advisor
1,850 posts

Jo Ann,

I don't think there is anything wrong with an occasional bit of in-line styling, when it's there for a reason. In this case my reason is that this particular styling deviates from the regular pattern of the theme and leaving it in-line makes it easier to spot and to edit - right there in direct connection with the element in question.
In this particular case, I would only move it to the default css file if I needed to include it in a media query or something like that.
Just my opinion of course... ;)
User 460613 Photo


Registered User
33 posts

I had to remove a lot of the code that CoffeeCup made and ended up with this.

body>
<iframe width="100%" height="373" style="border:none; background:transparent; overflow:hidden;"
id="fb_iframe" src="test/test.html">
&lt;a href="test.php" title="test"&gt;Check out my CoffeeCup Form&lt;/a&gt;
</iframe>
</body>

User 38401 Photo


Senior Advisor
10,951 posts

Yeah Per, that's why I was saying that sometimes it's not so detrimental to put it in the CSS, in this case it's a preference thing really, but I guess I'm of the mind that if you're going to use a CSS file at all, then use it so you don't have to look all over the files to make sure you got all the style codes updated etc. All in one place is a lot easier than having to check each HTML page to make sure you didn't miss something or if you can't find something. Just my preference in the end though :)
User 271657 Photo


Ambassador
3,816 posts

I had to remove a lot of the code that CoffeeCup made and ended up with this.

body>
<iframe width="100%" height="373" style="border:none; background:transparent; overflow:hidden;"
id="fb_iframe" src="test/test.html">
&lt;a href="test.php" title="test"&gt;Check out my CoffeeCup Form&lt;/a&gt;
</iframe>
</body>


Tim, is this in relation to Marc's form, or is this something different? If it's something you would like help with, best to start your own thread and give us a bit more info. ;)
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.