width based on content

R

richard

In CSS width has two basic uses.
1) width:auto causes the container to expand the entire width of it's
container.
2) width:100px defines the width to be that and no more or no less.

Ok I know about length and % too.

What I am looking at doing is basing the width on the content .

<div>example 1</div>
<div> This is example 2</div>

I don't see the need of having a 500px wide division just to show something
short in it like "Hi!".

You might say I'm say I'm looking for something flexible like a table cell.

yeah yeah, I know. You're gonna mouth off about my intelligence.
because we all know you were such an expert to begin with.
 
B

Beauregard T. Shagnasty

richard said:
In CSS width has two basic uses.
1) width:auto causes the container to expand the entire width of it's
container.
2) width:100px defines the width to be that and no more or no less.

Ok I know about length and % too.

What I am looking at doing is basing the width on the content .

<div>example 1</div>
<div> This is example 2</div>

I don't see the need of having a 500px wide division just to show
something short in it like "Hi!".

You might say I'm say I'm looking for something flexible like a table
cell.

How about using^W
yeah yeah, I know. You're gonna mouth off about my intelligence.
because we all know you were such an expert to begin with.

Oops. <deletes advice>
 
R

richard

You need a "shrink-to-fit" container. A table cell will do that, but so
will a float, an inline-block, or anything position: fixed or absolute.

So you choose whichever's other side effects you mind working around
least in the circumstances. Probably float.

In CSS3 I think they are proposing something like a choice between
width: greedy or width: shrink-to-fit for all elements, which would be a
good idea all round.


Actually your post was perfectly intelligent.

Thanks.
I found one answer to use <span> as an inline-block.
Works for me.
 
T

Tim Streater

Ben C said:
You need a "shrink-to-fit" container. A table cell will do that, but so
will a float, an inline-block, or anything position: fixed or absolute.

So you choose whichever's other side effects you mind working around
least in the circumstances. Probably float.

In CSS3 I think they are proposing something like a choice between
width: greedy or width: shrink-to-fit for all elements, which would be a
good idea all round.

Ah - an intelligent response from a gentleman as opposed to a wise guy.

Good to see.
 
K

Kamron Bennett

No, I'm going to ignore your question because you're being a jerk. Your
refusal to learn is no one's fault but your own.

sherm--

Him saying that is not his refusal to learn - its just him anticipating
the know-it-alls dealing with him as if he was an idiot to ask such a
simple question.
 
K

Kamron Bennett

Ah - an intelligent response from a gentleman as opposed to a wise guy.

Good to see.

Well Said!

It hurts the learning process when "Wise Guys/Know-it-Alls," behave as
if asking a question is an insult to one's intelligence. And you are
dumb to ask a question that may seem trivial. Guess what - I wouldn't
ask if I knew, neither am I going to ask "you" with the chip on your
shoulder and pent up expired rage from high school days when
know-it-alls were outcasts.
 
P

P E Schoen

"Sherm Pendley" wrote in message
His past behavior here is one giant refusal to learn. His
statement above is nothing but an excuse - the "mouthing
off" he refers to is people pointing out his constant clueless
gibberish for what it is.

I don't know all the past history, although even as a non-expert I have seen
some very questionable statements by Richard that should not have been given
as fact. But sometimes miscommunications and personal squabbles can lead to
unfair prejudice.
His anticipation is false, and your premature defense of him
is based on the incorrect assumption that he is *not* an idiot.

Even if someone is seen as an "idiot" by others who have greater knowledge,
it should not be a reason for knee-jerk attacks. But of course anyone who
posts wrong information and asserts it as factual should be called for it.
Do you think I jump on *every* simple question with a similar
response? Of course not. My opinion of him is based on
*years* of putting up with his wilful ignorance, his stubborn
refusal to learn, and his habit of insulting and arguing with
those who try to teach him.
To be frank, your rush to make a snap judgement is making
you look like a bit of a jerk too - but time will tell, as it did
with Richard the St00pid.

I'm not about to make a snap judgment about this, but some of the responses
have seemed a bit like a free-for-all piling on that is like mob behavior.
If he has in the past and still presently continued to proclaim falsehoods
as fact, then I would agree that corrections are necessary, but some of the
tone is disingenuous and a bit immature, and it does not contribute
positively to whatever discussion there may be.

The reason I'm responding to this is to point out a similar situation that I
have found myself in with the rec.pets.dogs.behavior newsgroup. I admit to
knowing possibly even less about dogs than HTML, and even with that I am a
novice, but I would like to be respected even if I have expressed some
ignorance and difficulty comprehending concepts or doing diligent research.

But what has happened there is that some unfortunate incidents in the past,
and the resulting exchange of insults and defamatory remarks, resulted in a
similar kneejerk rejection of any attempt on my part to initiate or
participate in civil discussion. I don't have enough experience with
advanced HTML to comment on Richard's "stupidity", but it seems as if here
he has attempted to ask a reasonable question and he is understandably
expecting another "spanking". But I don't presume to intrude or hold anyone
in judgment. I am just making an observation as a relative "newbie", and I
don't like to see threads become a mess of OT rude and inflammatory remarks,
rather than simple refutation of erroneous statements.

Thanks for being helpful to me.

Paul
 
B

Beauregard T. Shagnasty

P E Schoen wrote:
....
If he has in the past and still presently continued to proclaim
falsehoods as fact, then I would agree that corrections are
necessary, but some of the tone is disingenuous and a bit immature,
and it does not contribute positively to whatever discussion there
may be.

richard (Bullis) has a long-time reputation. It is not exactly that he
is really "st00pid" (again, a name he earned more than a decade ago),
but mostly because of his attitude. Witness the last line of his first
post in this thread.

Many times he will respond to advice given him with a comment similar to
"That's not what I wanted, asshole!" and he almost never thanks anyone
for correct advice. And this is not just here in HTML groups; he's all
over Usenet.

I guess one could say he is a Usenet legend.
 
C

Captain Paralytic

Him saying that is not his refusal to learn - its just him anticipating
the know-it-alls dealing with him as if he was an idiot to ask such a
simple question.
He has been around for many years and has not managed to learn in all
that time. He is also habitually rude even when people do try to help
him.
Please do not make such statements until you know what you are talking
about.
 
T

Tim Streater

Sherm Pendley said:
I think you should review this thread - Richard's question and my resp-
onse to it. He basically said "I think this group is full of jerks, but
I'm going to ask a question anyway," and I responded by saying some-
thing along the lines of "no, I'm not going to answer someone who just
called me a jerk."

I didn't make a snap judgement, and I didn't pile on - I responded to
Richard's own attitude.


You should review Richard's history here. He's been asking ridiculous
questions here for *years*, arguing against or ignoring the answers,
then asking the same thing a short time later. My opinion of him isn't
a snap judgement based on a single newbie question; he's spent a long
time developing his reputation here.

In which case, I would recommend not responding at all to his request.

The first time I ever posted here (several years ago now) it was because
I had a problem with unexplained extra space in table cells. I'd posted
some quick html which included the likes of <p></p> to space things out
a bit. What I then received was a barrage of abuse about that and other
irrelevancies, which I found astonishing. A bit later, along comes Ben C
who quite calmly said to the effect of "If you've left out the DOCTYPE
you've probably triggered quirks mode".

Unfortunately:

a) I'd never previously understood the significance of the DOCTYPE
b) I'd never heard of quirks mode

so I went off and read up about that and so fixed my problem.

Too bad more people don't take this simple, straightforward, and useful
approach.
 
B

Beauregard T. Shagnasty

Tim said:
so I went off and read up about that and so fixed my problem.

That's great, and I applaud your efforts. Problem is that richard never
does that, instead just blunders along and asks the same kind of
questions over and over without ever learning. He also rarely will show
any working/not working example of his attempts by publishing an URL of
his efforts.

Have you ever seen his web site? http://1littleworld.net/
 
D

Doug Miller

That's great, and I applaud your efforts. Problem is that richard never
does that, instead just blunders along and asks the same kind of
questions over and over without ever learning. He also rarely will show
any working/not working example of his attempts by publishing an URL of
his efforts.

Have you ever seen his web site? http://1littleworld.net/
That's ... amazing.
 
D

dorayme

That's ... amazing.

You are easily amazed. What happens when you come across really
interesting things like very clever scientific theories, do you
suffer near heart attacks then? Is that a common trait of members
of the GRW (Gang of Richard Watchers)? Do your members have some
common economically rational health insurance to have doctors
watch out for your supersensitive conditions?
 
R

richard

That's great, and I applaud your efforts. Problem is that richard never
does that, instead just blunders along and asks the same kind of
questions over and over without ever learning. He also rarely will show
any working/not working example of his attempts by publishing an URL of
his efforts.

Have you ever seen his web site? http://1littleworld.net/

Did you know that many people buy domain names purely for email?
The only reason I put that piece of crap up was so that you'd see something
instead of "index of".

When I feel it is necessary, I do post an example to my site and link to it
for my question. I also validate my code, which is far more than most
people even consider doing.

You never seem to post a question or a URL to anything for any reason. You
just mouth off.
 
T

Tim Streater

Sherm Pendley said:
Did you post a snippet of code, or a URL to a complete page? I wonder,
because much of the "abuse" that newcomers receive here results from
their doing the former, and because (in your summary) Ben appeared to
be guessing about whether you'd left out the DOCTYPE or not. It's lucky
that his guess turned out to be correct, but that doesn't negate the
point that he shouldn't have had to guess to begin with, and would not
have had to do so if you'd posted a URL.

I posted a small complete example (25 lines or so) that I had checked to
be sure that it exhibited the problem I was experiencing. That is, it
started with <html> and ended with </html> (i.e., no DOCTYPE).

I'd wanted to make it small to not clutter up the post, and so had
thrown in some <p></p> as a cheap way to lay it out a bit. Probably
today I'd know enough to just put in some margin on the table or
something.
If you posted a snippet, the requests ("abuse," as you refer to it) for
a URL turned out to be far from irrelevant. The answer *did* turn out
to be something you hadn't included, which would have been revealed
if you'd posted a URL.

Well, here's another thing. This assumes that a poster has some webspace
to call their own. At the time I was posting from work and it was not
going to be possible to give a work-based URL, and outside work I had no
use (at the time) for my own website. (In fact, I'm not sure that my
existing ISP even offers it.)

This can be both good and bad. Good is that it can force one to shrink
an example down to the minimum that exhibits the problem, which can
highlight the issue so no post is required at all :)

Bad is that a more complex issue may not be reducible in this way.
Nothing is more off-putting that 500 lines of code posted with the
assumption that someone is going wade through it.
Or, were the comments about invalid code?

It *felt* like I was being picked up on stuff I wasn't asking about and
which had nothing to do with the issue said:
If so, the fact is that, by
definition, there is no "correct" or "incorrect" way for a browser to
handle invalid code. That being the case, the best way to handle any
unexpected behavior is to first validate one's code, to eliminate one
possible source of problems.

I agree, but suppose the newbie doesn't know that? This is one of that
nice Mr. Rumsfeld's "unknown unknowns", just as quirks mode was for me.
If you don't know you don't know it, you can't ask questions about it.
Again, I haven't checked the archives, and I apologize if I've misread
the situation, but I've seen newbies react badly to well-intentioned
and sound advice far too many times to take any claim of "abuse" as a
given. Far more often, a newbie has put a lot of work into a product,
and reached a point where he or she is highly frustrated because it
isn't working. When one has reached such a point (and I've certainly
been there myself), it's all too easy to misinterpret constructive,
fact-based criticism as abuse or an attack.

Sure. I guess the thing is very often a newbie doesn't know how to ask a
succinct question that is to the point.

Anyway - thanks for the thoughtful response.
 
C

Captain Paralytic

You are easily amazed.
Maybe he means that it's amazing that someone who has been posting
questions on html & php for so long has only managed to come up with a
site like that.
 
K

Kamron Bennett

He has been around for many years and has not managed to learn in all
that time. He is also habitually rude even when people do try to help
him.
Please do not make such statements until you know what you are talking
about.

Well, it still has something to do with the way he was or still is
treated. Even though he may be lazy given your descriptions and based
on what many people tend to do at times but *I* sincerely disagree
with being so harsh. With many people laziness is inborn and
therefore quite hard to get rid of. Additionally, a lot of persons
find comfort in newsgroups (myself included) and would much prefer
getting a response from on as opposed to google, I know at times
google may not be a good resource for a question. I tried to find the
difference between Twin Cam and Double Overhead cam and to this day
I haven't found a satisfying response. Twin Cam is described as Double
Overhead Cam by some sources. I know/swear there is a difference
which was explained to me by a mechanic, hence my point some people
get things done by being "spoon fed."

Accept my apologies for digressing however?
 
R

richard

Well, it still has something to do with the way he was or still is
treated. Even though he may be lazy given your descriptions and based
on what many people tend to do at times but *I* sincerely disagree
with being so harsh. With many people laziness is inborn and
therefore quite hard to get rid of. Additionally, a lot of persons
find comfort in newsgroups (myself included) and would much prefer
getting a response from on as opposed to google, I know at times
google may not be a good resource for a question. I tried to find the
difference between Twin Cam and Double Overhead cam and to this day
I haven't found a satisfying response. Twin Cam is described as Double
Overhead Cam by some sources. I know/swear there is a difference
which was explained to me by a mechanic, hence my point some people
get things done by being "spoon fed."

Accept my apologies for digressing however?

Precisely. When googling for specific information, the responses are not
based upon what you want, but upon how much advertising a particular site
might have, that may or may not have anything related to your inquiry.

While one may get harassed, flamed and what not in a newsgroup, someone is
bound to come along with exactly the information you want.

As to your question on "cams", twin does not necessarily mean they are
positioned "overhead". DOHC came along after the twin cams. But I think
it's all in the matter as to which mechanic you speak to as to how it gets
defined.
 
D

Doug Miller

Maybe he means that it's amazing that someone who has been posting
questions on html & php for so long has only managed to come up with a
site like that.

;-)
 
D

Doug Miller

I tried to find the
difference between Twin Cam and Double Overhead cam and to this day
I haven't found a satisfying response. Twin Cam is described as Double
Overhead Cam by some sources. I know/swear there is a difference
which was explained to me by a mechanic, hence my point some people
get things done by being "spoon fed."

It's waaaaay OT for this group, but if you want to email me (doug at milmac
dot com) I'll be happy to explain it to you. I've done most of my own auto
repairs and service for over 30 years, including several engine and
transmission rebuilds.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,861
Messages
2,569,878
Members
46,087
Latest member
KVTRuth63

Latest Threads

Top