Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

css tactics and best practices.

Hi there;

In my projects, i have been dealing with css a lot.

Ok, for an element and this generally div, i setup width, height and margin.

Then suppose i want another element near to this first one. Should i use a relative position or absolute? Should the element float?

Please consider all 3 mainstream browsers.

Regards.
ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain 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
SOLUTION
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
What you are asking is like asking how to build a house.  The answer is "it depends".  

What kind of look do you want?  

What kind of content is involved?

What is the target audience?

You are just putting a blank sheet of paper in front of us.

Start developing, and as issues come up we will try to help.

As far as best practices.

Code to the latest standards.
Design everything so a visually impaired visitor using a reader can navigate.
Make content not effects the important thing on every page
Leave your ego outside.  Nobody but you cares about the cute effects


Cd&
Avatar of jazzIIIlove

ASKER

one question is that, what about padding and margin?

I want to have some spacing between elements. What can be the best practice in this sense?

I generally design as if line by line (suppose you add the elements aligned horizontally and want to give spacing between them), what is the best practice for this need?

Regards.
Margins - that's what they are for. Methods vary - sometimes you give each element a left and right margin - but that might not suit situations where you want the left and right elements flush against the parent container boundaries.
Sometimes you give a left or right margin only another option is to give centre elements margins and leave the outer ones with no margin - or set a margin (left right or both) and then remove for the element you don't want to have.