tariq_ews Posted October 24, 2007 Share Posted October 24, 2007 Can any explain css class float >> left right centreThanks in advance Link to comment Share on other sites More sharing options...
Reg Edit Posted October 24, 2007 Share Posted October 24, 2007 Can any explain css class float >> left right centreThanks in advanceHave a look at the w3schools tutorials here which gives the basic description, and also has some links to the "try it yourself" editor which lets you edit and see the effect. Link to comment Share on other sites More sharing options...
Synook Posted October 24, 2007 Share Posted October 24, 2007 There is no float:center; btw Link to comment Share on other sites More sharing options...
tariq_ews Posted October 24, 2007 Author Share Posted October 24, 2007 wt is the differents between bleow wt is inherit<img height="2" style="float:inherit" > why we use none<img height="2" style="float:none">and there is no float:center plz explain Link to comment Share on other sites More sharing options...
Synook Posted October 24, 2007 Share Posted October 24, 2007 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 More sharing options...
SpOrTsDuDe.Reese Posted October 24, 2007 Share Posted October 24, 2007 The tutorial discusses that. Link to comment Share on other sites More sharing options...
tariq_ews Posted October 24, 2007 Author Share Posted October 24, 2007 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 More sharing options...
jlhaslip Posted October 24, 2007 Share Posted October 24, 2007 the p tag is the image's parent Link to comment Share on other sites More sharing options...
tariq_ews Posted October 25, 2007 Author Share Posted October 25, 2007 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 More sharing options...
Synook Posted October 25, 2007 Share Posted October 25, 2007 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 More sharing options...
tariq_ews Posted October 25, 2007 Author Share Posted October 25, 2007 Yes this is the question i want float:right;if possible inherit the second pic i want second picture on right as first page Link to comment Share on other sites More sharing options...
Synook Posted October 25, 2007 Share Posted October 25, 2007 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 More sharing options...
tariq_ews Posted October 26, 2007 Author Share Posted October 26, 2007 yes inherit means that it takes from the parent element as OOP programmingthanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.