Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > width based on content

Reply
Thread Tools

width based on content

 
 
richard
Guest
Posts: n/a
 
      02-15-2011
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.
 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-15-2011
richard wrote:

> 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>

--
-bts
-It's "its", not "it's"
 
Reply With Quote
 
 
 
 
richard
Guest
Posts: n/a
 
      02-15-2011
On Tue, 15 Feb 2011 16:19:36 -0600, Ben C wrote:

> On 2011-02-15, richard <(E-Mail Removed)> wrote:
>> 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.

>
> 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.
>
>> yeah yeah, I know. You're gonna mouth off about my intelligence.
>> because we all know you were such an expert to begin with.

>
> Actually your post was perfectly intelligent.


Thanks.
I found one answer to use <span> as an inline-block.
Works for me.
 
Reply With Quote
 
Tim Streater
Guest
Posts: n/a
 
      02-15-2011
In article <(E-Mail Removed)>,
Ben C <(E-Mail Removed)> wrote:

> On 2011-02-15, richard <(E-Mail Removed)> wrote:
> > 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.

>
> 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.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
 
Reply With Quote
 
Kamron Bennett
Guest
Posts: n/a
 
      02-16-2011
On 02/15/2011 04:32 PM, Sherm Pendley wrote:
> richard<(E-Mail Removed)> writes:
>
>> yeah yeah, I know. You're gonna mouth off about my intelligence.

>
> 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.

--
Simplicity and Knowledge are all relative. You may find it strange that
someone would ask such a "simple" question. Had he known he wouldn't
have asked!
 
Reply With Quote
 
Kamron Bennett
Guest
Posts: n/a
 
      02-16-2011

>
> 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.
 
Reply With Quote
 
P E Schoen
Guest
Posts: n/a
 
      02-16-2011
"Sherm Pendley" wrote in message
news:(E-Mail Removed)...

> Kamron Bennett <(E-Mail Removed)> writes:


>> Him saying that is not his refusal to learn


> 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.

>> - its just him anticipating the know-it-alls dealing with him
>> as if he was an idiot to ask such a simple question.


> 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.

>> Simplicity and Knowledge are all relative. You may find it
>> strange that someone would ask such a "simple" question.
>> Had he known he wouldn't have asked!


> 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

 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-16-2011
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.

--
-bts
-Four wheels carry the body; two wheels move the soul
 
Reply With Quote
 
Captain Paralytic
Guest
Posts: n/a
 
      02-16-2011
On Feb 16, 4:20*am, Kamron Bennett <(E-Mail Removed)> wrote:
> On 02/15/2011 04:32 PM, Sherm Pendley wrote:
>
> > richard<(E-Mail Removed)> *writes:

>
> >> yeah yeah, I know. You're gonna mouth off about my intelligence.

>
> > 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.

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.
 
Reply With Quote
 
Tim Streater
Guest
Posts: n/a
 
      02-16-2011
In article <(E-Mail Removed)>,
Sherm Pendley <(E-Mail Removed)> wrote:

> "P E Schoen" <(E-Mail Removed)> writes:
>
> > 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.

>
> 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.
>
> > I am just making an observation as a relative "newbie"

>
> 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.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resize Gridview width (not column width) based on size of databrought back. Hartman_Ralph@Hotmail.com ASP .Net Web Controls 1 06-13-2009 10:21 AM
Cell width error when containing variable width content mj.redfox.mj@gmail.com HTML 0 01-26-2006 03:37 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
css - setting width based on browser width ppcguy HTML 3 08-26-2005 06:51 AM
Fixed layout width based on browser window width msswasstastic@aol.com HTML 11 01-28-2005 07:36 AM



Advertisments