0
Can I use only html to create a something like below code.
6 Answers
+ 5
@visph
Try to run this HTML code
..
<!DOCTYPE html>
<html>
<body>
<h2>The Old Way - using float</h2>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="float:left; width:150px; height:75px; margin:10px; border:3px solid #73AD21;">Floating box</div>
<div style="clear:left; border:3px solid red;">Another box, after the floating boxes...</div>
</body>
</html>
..
Tell me now is it give the same result as its original or not? š
+ 5
'style' attribute use Css: there's no differences between use of external css rules (in another file or embeded in <style> tag), or inlined in the 'style' attributes of elements ^^
+ 4
You can but it is complex !!
replace all what written in CSS classes where each class attribute itself found in the html tag
šš
+ 4
@Ammar:
Html attributes dedicated to styling doesn't cover all css possibilities, and almost are deprecated in Html5...
+ 3
What did you mean by "only html"?
In my point of view, Html+Css is quite "only Html", because Css was created to separate style from structure in Html code... so without Css you can only do very very basic layouts ^^ And about your specific code (happy to see that you probably never more post the question now you've get the code to do your assignement), there's no ways to do equivalent output with "strictly only html" ^^
+ 3
In this code CSS is used, but by the local way.