[sclug] Simple WYSIWYG HTML editor?

Simon Champion simon at spudley.com
Mon Mar 3 16:16:16 UTC 2008


Hia,

> And if anyone can come up with a way of using CSS to say 'I want this 
> column to be wide enough to contain this string without wrapping it, but 
> no wider',

Something like this, perhaps?

{maxwidth:25em;} /*where 25 is the max number of characters in your text*/

However, the maxwidth style is not fully supported, particularly in IE -- not sure about IE7, but it certainly doesn't work in IE6, which makes it next to useless for the time being. Most people just don't bother with it.
You could also try {white-space:no-wrap;} which might help you force the box size to fit a particular block of text.


> or 'I want this box to be the same size as that box', I will 
> be a happy man.

Something like this....

<style>
.bothboxes {height:30px; width:80px;}
.box1 {/*...stuff specific to box1...*/}
.box2 {/*...stuff specific to box2...*/}
</style>
...
<div class="bothboxes box1">This is box 1</div>
<div class="bothboxes box2">This is box 2</div>



What you want can probably be done, but you are right, in that CSS does have some shortcomings that make certain things that should be obvious into quite difficult feats. The real CSS affectionados insist that you should never ever ever use a <table> tag again, but some of the things that html tables do which are actually quite useful are very hard to make work in CSS.

But in general, CSS is a real boon for developers. It does make a lot of things very easy. A bit of pragmatism is the key: embrace it, use it, love it, but don't be afraid to fall back on the older ways of doing things if they make things easier.


Regards,



   Simon C.

ps- Sorry David for sending you a part-written version of this message.

-- 
SkycomUK.com: 0800 and 0845 numbers for your business.
Get 10% discount on setup fees with this code: KXF448RD77.



You wrote:
> Adam Trickett wrote:
> [...]
> > If you are using in-line styles then you are doing it very wrong. In-line 
> > styles are what you get from automated tools, and a clear sign of poor 
> > markup. Build you pages using only structural HTML, you are allowed the odd 
> > class and id attribute, then use an external style sheet to add all the 
> > eye-candy.
> 
> Yes, that's what I used to think... until I discovered that the CSS 
> layout algorithm is, ahem, rather simplistic and only works left-right 
> top-bottom. Which means that you can't put your variable sized header 
> bar after your body text in the HTML file, even though it's far more 
> useable that way for non-CSS readers.
> 
> In other words, implementation details of your CSS govern the layout and 
> structure of your HTML.
> 
> And if anyone can come up with a way of using CSS to say 'I want this 
> column to be wide enough to contain this string without wrapping it, but 
> no wider', or 'I want this box to be the same size as that box', I will 
> be a happy man.
> 
> -- 
> David Given
> dg at cowlark.com
> 




More information about the Sclug mailing list