Reputation: 240
Open this fiddle in Chrome and Firefox (or IE9, Opera) and see differences.
or see Image:
Can chrome behave like firefox?
Upvotes: 0
Views: 1894
Reputation: 447
I believe no, it can not. Your best bet is to write this in a way that will look the way you want on Chrome and use that version when you detect whether the user is using Chrome or an other browser. See this for more details.
OR
You can use code that will look the same or similar in all current browsers. For your example you need to add:
<span style="float:left">Test </span>
to your text.
Another solution is this:
<html>
<head>
<style type="text/css">
#test{
position: relative;
left: 120px;
}
</style>
</head>
<body style="margin:0px; padding: 0px;">
<span style="width: 100px; background:red; float: left; clear: left; height: 4px;" ></span>
<span style="width: 220px; background:red; float: left; clear: left; height: 4px;" ></span>
<div id = "test">
<span>Test </span>
</div>
</body>
</html>
Upvotes: 1
Reputation: 311
Just give the style 'float:left' to the div
<html>
<head>
</head>
<body style="margin:0px; padding: 0px;">
<span style="width: 100px; background:red; float: left; clear: left; height: 4px;" ></span>
<span style="width: 220px; background:red; float: left; clear: left; height: 4px;" ></span>
<div style="float:left">
<span>Test </span>
</div>
</body>
</html>
Upvotes: 1