Link to home
Start Free TrialLog in
Avatar of John S.
John S.Flag for United States of America

asked on

How can I re-create this look using CSS ?

I am trying to learn how to render this effect in pure HTML and CSS, with no frameworks. I have tried to study the source code of the page, but it is so complicated.



Here is the background image:



Here is the transparent overlay:



Ideally, I want to just have this in its own DIV.

<div id="pageHeader">

</div>

Open in new window


Can anyone help me re-create the look? It doesn't have to be exact, but I would love to see how they did this, and learn this technique. I especially like how they centered and styled the form to overlay on the bottom.

Note: Individually, I understand the basics of each CSS rule that is probably applied here, ie. backgrounds, padding, margins. I am confused on how to put them all together.

Thanks for looking.

Regards,

John
Avatar of David S.
David S.
Flag of United States of America image

First of all, John is talking about cmitfranchise[dot]com

Do you have experience using the DOM inspector included in your browser's developer tools? They are quite valuable in seeing how CSS is being applied. However, sites built like that do have a bewildering amount of code to sift through.

There are two main ways to get elements to overlap. The first is using negative margins and the second, which was used in your example, is to use absolute positioning, although it's unclear to me why they chose to since it's just a background image anyway.

As to the horizontal centering, they gave one of the container elements "#main .fusion-row" both a max-width and auto left and right margins.
http://learnlayout.com/margin-auto.html

By the way, they were neglectful in how much text is embedded in that image. But it is rather complex to make that with only the laptop as an image. Unfortunately, vertical centering can be rather complicated to do in CSS.
Avatar of John S.

ASKER

Thank you for the reply. I am still trying to achieve this result... lol. I will try again and post my closest attempt.
I think the large background image could be placed in a containing div with no repeat, then the other elements could be relatively positioned within the container div:

<div style="background-image: url('bg.png');  background-repeat: no-repeat;">
 <div style="left: 200px; top: 20px"><img src="whynot.png"></div>
 <div style="top: 200px"><form>...</form></div>
</div>

Open in new window

Avatar of John S.

ASKER

@NerdsOfTech, hey thanks! I will try that.
ASKER CERTIFIED SOLUTION
Avatar of NerdsOfTech
NerdsOfTech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
NerdsOfTech:

Who are you saying has declared that using a CSS framework is a best practice? Certainly many people find them helpful, but that's not the same thing.

Also who said anything about percentages? Top and bottom margins and padding when set as a percentage are based off of the containing block's width, not its height as one might expect.
Avatar of John S.

ASKER

thanks!