Jump to content

%; not pxs?


eduard

Recommended Posts

Another time a very serious problem which I can't write on the internet! For my website:To make my website suitable for all browsers, I've to write my css in %; not in pxs?

Link to comment
Share on other sites

Both are good, it depends on where you're using them and what you're using them for. Different elements can use different units.
But can you be more specific (or where can I read about it?) or is it always save when I use %?
Link to comment
Share on other sites

Eddie baby..relax. Pixels are specific. The higher the resolution the smaller the pixel. % and em's are relative, maybe to parent containers. Must be careful using these. But they scale better for the user. You'll have to read about the specificity of scaling units on the internet or ask a more specific question here somewhere. Read this; http://www.impressivewebs.com/width-100-percent-css/ Hope that helps.

Link to comment
Share on other sites

Eddie baby..relax. Pixels are specific. The higher the resolution the smaller the pixel. % and em's are relative, maybe to parent containers. Must be careful using these. But they scale better for the user. You'll have to read about the specificity of scaling units on the internet or ask a more specific question here somewhere. Read this; http://www.impressiv...00-percent-css/ Hope that helps.
Many thanks!
Link to comment
Share on other sites

Many thanks!
Is an inline-element the same as a child element? And the parent element in %?The child element in pxs? Edited by eduardlid
Link to comment
Share on other sites

"Child" and "parent" are relationships between elements. In this example, <h1> is a child of <div>, <div> is the parent of <h1>

<div>    <h1></h1></div>

Inline and block are two different rendering modes for an element. When an element is a block, it behaves like a box. If an element is inline, it will behave like text.

Link to comment
Share on other sites

To make a responsive website looks good on many different screens you will want to work in percentages or ems. CSS media queries will also be useful if you want to change your CSS depending on the device your site is being viewed on. Try to avoid pixels wherever possible.

Link to comment
Share on other sites

"Child" and "parent" are relationships between elements. In this example, <h1> is a child of <div>, <div> is the parent of <h1>
<div>	<h1></h1></div>

Inline and block are two different rendering modes for an element. When an element is a block, it behaves like a box. If an element is inline, it will behave like text.

Many thanks for your explanation! What's the difference between a box and a container? Edited by eduardlid
Link to comment
Share on other sites

To make a responsive website looks good on many different screens you will want to work in percentages or ems. CSS media queries will also be useful if you want to change your CSS depending on the device your site is being viewed on. Try to avoid pixels wherever possible.
So, I've to adapt my website to the most used screens? andWhen do I use pxs and when % because I haven't understood it good?
Link to comment
Share on other sites

They can refer to the same element, but in different contexts. A container is always a box, but a box is not necessarily a container. "Container" refers to an element that contains other elements, a box refers to how an element is rendered.

Link to comment
Share on other sites

They can refer to the same element, but in different contexts. A container is always a box, but a box is not necessarily a container. "Container" refers to an element that contains other elements, a box refers to how an element is rendered.
So, a container is an element of a box?
Link to comment
Share on other sites

A container is an element that has other elements inside it.
<div>  <-- container 	 <p>Hello</p>  <--- element inside container</div>

Container and element are the content of a box?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...