lemmin Posted August 13, 2008 Share Posted August 13, 2008 I cannot figure out a way to fix the width of a nobr object in Firefox. Is it possible? <nobr style="width:50px"></nobr> The above code works exactly as expected in IE, but not in Firefox. Thanks. Quote Link to comment Share on other sites More sharing options...
haku Posted August 13, 2008 Share Posted August 13, 2008 You can't set it in a tag, but you can set it in CSS: whitespace: nowrap; Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 13, 2008 Author Share Posted August 13, 2008 What object, exactly, am I applying that CSS to? I looked around and found that Firefox won't apply dimensions to objects that are displayed inline, which my nobrs are. To get around it, I set them to display as blocks and floated them next to eachother. I really hate floating things, but I can't find any other way to make this work in both IE and FF without using a table. Quote Link to comment Share on other sites More sharing options...
haku Posted August 13, 2008 Share Posted August 13, 2008 Too much vague information. Need a link. Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 14, 2008 Share Posted August 14, 2008 What the hell is <no br /> anyway? It is one of the many stupid html tags invented. If you don't want the the text to wrap, then you make that div large enough, tell it to nowrap, or you set overflow to the appopriate level. I never found a need to use <no br /> 's. I can see why firefox has problems displaying this for you. <no br /> is an inline object (obviously) and making it display: block; is just nonsense. Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 14, 2008 Author Share Posted August 14, 2008 If you don't want the the text to wrap, then you make that div large enough Firefox won't apply dimensions to objects that are displayed inline Your solution is fine until I want to put the divs next to eachother; actually, the nobrs would work just the same until I want to do that. If I used a div, the code would be exactly the same except I would have to add more styles. Disregarding a tag because you have never heard of it is just nonsense. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 14, 2008 Share Posted August 14, 2008 What are trying to archive? a two column layout of some kind? Have a look at this site and use one of the layouts as a template. This is what I used to do when I started out with CSS layouts. Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 14, 2008 Author Share Posted August 14, 2008 Yea, pretty much. I just want two objects to be inline and still be able to size them. In Internet Explorer, you put the objects inline and then size them to accomplish that, as one might expect; this doesn't work in Firefox, though. Anyway, like I said, I got around it by floating them as blocks, which is the same method that the website you linked to uses, but I never liked doing that. It seems to be the only way to keep this kind of layout cross-browser compatible, though. Thanks for the help, guys. Quote Link to comment Share on other sites More sharing options...
haku Posted August 14, 2008 Share Posted August 14, 2008 Disregarding a tag because you have never heard of it is just nonsense. But disregarding it because it isn't valid code is entirely reasonable. And <no br> is invalid code. There's a reason only IE uses it - IE is a non-standards compliant browser. Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 14, 2008 Author Share Posted August 14, 2008 <nobr> is perfectly valid, it is just not "accepted" by w3c. It works fine in every browser I have ever used. http://msdn.microsoft.com/en-us/library/ms535856(VS.85).aspx In any case, the question was more about fixing the width of an inline object, not nobrs. If I had used inline divs in the example the question would be the same. Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 14, 2008 Share Posted August 14, 2008 Disregarding a tag because you have never heard of it is just nonsense. I have heard of it before. I am disregarding it for a good reason. I design within the web 2.0 expectations and standards. In doing so, I separate by content - html - and presentation - css. <no br> is not content. It is something that visually changes the text, to make it more pleasing to the eye. Therefore, this should go striclty under the css file. You need to understand that although it works in IE and you only may need to fudge a few things here and there to make it in FF, this is NOT a semantic way to go around doing it. - You can make a turd shine brighter, but it still is a turd. Typically, I would give you a solution now, but I'm tired of people sticking me in the back by calling my remarks 'nonsense.' I have done quite a lot of development work and have never used silly things as <no br> Quote Link to comment Share on other sites More sharing options...
haku Posted August 14, 2008 Share Posted August 14, 2008 <nobr> is perfectly valid, it is just not "accepted" by w3c. Which is what makes it not valid! It works fine in every browser I have ever used. Then why are you having this problem? You have a standards compliant browser that isn't accepting it, and you are trying to say that it's standards compliant? Sorry, I think you will have troubles convincing anyone of that. Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 15, 2008 Author Share Posted August 15, 2008 I'm tired of people sticking me in the back by calling my remarks 'nonsense.' [...] and making it display: block; is just nonsense. Do unto others? Then why are you having this problem? You have a standards compliant browser that isn't accepting it, and you are trying to say that it's standards compliant? Sorry, I think you will have troubles convincing anyone of that. You need to understand that although it works in IE and you only may need to fudge a few things here and there to make it in FF, this is NOT a semantic way to go around doing it. What you two don't seem to understand is that the <nobr> tag works exactly as expected in both browsers. As I said before, the question wasn't intended to be about nobrs. I just wanted to know how to fix a size to an inline object in FF, which can't be done. Thanks for the help, though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.