Jump to content

class float


tariq_ews

Recommended Posts

There is no such value "center" for the "float" rule, you can either float it to the left, the right, or not float it. Inherit means that the value takes from the parent element.

Link to comment
Share on other sites

inherit not work when i try this codein http://www.w3schools.com/css/tryit.asp?fil...e=trycss_float2the second css img not go to right it is still in left <html><head><style type="text/css">img {float:right;border:1px dotted black;margin:0px 0px 15px 20px;}</style></head><body><p>In the paragraph below, the image will float to the right. A dotted black border is added to the image.We have also added margins to the image to push the text away from the image:0 px margin on the top and right side, 15 px margin on the bottom, and 20 px margin on the left side of the image.</p><p><img src="logocss.gif" width="95" height="84" />This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.</p><p><img style="float:inherit" src="logocss.gif" width="95" height="84" /> This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.</p></body></html>

Link to comment
Share on other sites

Without <p> tag the inherit not working<html><head><style type="text/css">img{float:right;border:1px dotted black;margin:0px 0px 15px 20px;}</style></head><body>In the paragraph below, the image will float to the right. A dotted black border is added to the image.We have also added margins to the image to push the text away from the image:0 px margin on the top and right side, 15 px margin on the bottom, and 20 px margin on the left side of the image.<img src="logocss.gif" width="95" height="84" />This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.<img style="float:inherit" src="logocss.gif" width="95" height="84" />This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.</body></html>

Link to comment
Share on other sites

Because then it inherits from the <body> tag... what element do you want it to inherit the value from...

Link to comment
Share on other sites

But what do you want it to inherit from? Why not just give it float:right; ? Remember, inherit means that it takes from the parent element.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...