473,657 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting a <p> to have a fixed width regardless of content

hi all

i know this isnt the right place to post a css thing but i dont know
any other good forums to post to.

what im trying to do is get a paragraph tag to display like a textbox
but put links in there which can be clicked on. (so a textbox wont
work). i want each <pto have the same length (regardless of link
length) so they line up ok when placed in rows.

is this possible?

here is my styling so far of the <p:

style='padding: none;margin:0; display:inline; width:100px;'

this gets the p on the same line as the other stuff (which i want) but
can get the width to work?!

regards

Marc

Aug 23 '06 #1
12 1666
libsfan01 wrote:
hi all

i know this isnt the right place to post a css thing but i dont know
any other good forums to post to.
news:comp.infos ystems.www.authoring.stylesheets

what im trying to do is get a paragraph tag to display like a textbox
but put links in there which can be clicked on. (so a textbox wont
work). i want each <pto have the same length (regardless of link
length) so they line up ok when placed in rows.

is this possible?
No. The width property does not apply to inline elements.

<URL: http://www.w3.org/TR/CSS21/visudet.html#q4 >

[...]
--
Rob
Aug 23 '06 #2
Rik
RobG wrote:
libsfan01 wrote:
>hi all

i know this isnt the right place to post a css thing but i dont know
any other good forums to post to.

news:comp.infos ystems.www.authoring.stylesheets

>what im trying to do is get a paragraph tag to display like a textbox
but put links in there which can be clicked on. (so a textbox wont
work). i want each <pto have the same length (regardless of link
length) so they line up ok when placed in rows.

is this possible?

No. The width property does not apply to inline elements.

Well, a good thing <pis a block then. Apply width freely.

--
Grtz,

Rik Wasmus
Aug 23 '06 #3
No. The width property does not apply to inline elements.
ive tried changing it to span too and applying a block to the display
but this just sends it to a new line. is there some way of getting a
kind of 'block-inline' display whereby width is adhered to but display
is online and extra content is missed off, like a textbox but readonly
so that a link is clickable?

any help would be greatly appreciated :-)

Aug 23 '06 #4
Rik wrote:
RobG wrote:
>libsfan01 wrote:
<snip>
>>is this possible?

No. The width property does not apply to inline elements.

Well, a good thing <pis a block then. Apply width freely.
As the OP is applying:-

| style='padding: none;margin:0; display:inline; width:100px;'

- (and disregarding the fact that 'none' is not a valid value for
padding) to the P element its display style becomes inline and the
width value does not apply to it.

Richard.

Aug 23 '06 #5
Rik
Richard Cornford wrote:
Rik wrote:
>RobG wrote:
>>libsfan01 wrote:
<snip>
>>>is this possible?

No. The width property does not apply to inline elements.

Well, a good thing <pis a block then. Apply width freely.

As the OP is applying:-
>style='padding :none;margin:0; display:inline; width:100px;'

- (and disregarding the fact that 'none' is not a valid value for
padding) to the P element its display style becomes inline and the
width value does not apply to it.
Hehe, my bad, that will teach me to read the original post instead of just
the answer :-)

--
Grtz,

Rik Wasmus
Aug 23 '06 #6
As the OP is applying:-
>
| style='padding: none;margin:0; display:inline; width:100px;'

- (and disregarding the fact that 'none' is not a valid value for
padding) to the P element its display style becomes inline and the
width value does not apply to it.

Not valid is it? seems to work fine for me. so anyway ive changed
'none' to '0' and it still dont work :-(

Aug 23 '06 #7
Rik
libsfan01 wrote:
>As the OP is applying:-
>>style='paddin g:none;margin:0 ; display:inline; width:100px;'

- (and disregarding the fact that 'none' is not a valid value for
padding) to the P element its display style becomes inline and the
width value does not apply to it.


Not valid is it? seems to work fine for me. so anyway ive changed
'none' to '0' and it still dont work :-(
Because you indeed force the <pto be inline, and an inline element has no
width. You might want to 'display: inline-block;', but that's an ugly
solution IMO.

Grtz,
--
Rik Wasmus
Aug 23 '06 #8
libsfan01 wrote:
>No. The width property does not apply to inline elements.

ive tried changing it to span too and applying a block to the display
but this just sends it to a new line. is there some way of getting a
kind of 'block-inline' display whereby width is adhered to but display
is online and extra content is missed off, like a textbox but readonly
so that a link is clickable?

any help would be greatly appreciated :-)
Ask in a CSS news group as indicated in my first reply.
--
Rob
Aug 23 '06 #9
Rik wrote:
Richard Cornford wrote:
>Rik wrote:
>>RobG wrote:
libsfan01 wrote:
<snip>
>>>>is this possible?
No. The width property does not apply to inline elements.
Well, a good thing <pis a block then. Apply width freely.
As the OP is applying:-
>>style='paddin g:none;margin:0 ; display:inline; width:100px;'
- (and disregarding the fact that 'none' is not a valid value for
padding) to the P element its display style becomes inline and the
width value does not apply to it.

Hehe, my bad, that will teach me to read the original post instead of just
the answer :-)
I'll cop some of that, I shouldn't have trimmed the relevant line.
--
Rob
Aug 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10555
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
14
4103
by: Dylan Nicholson | last post by:
Been playing around with this all day, and haven't found a solution I like yet. Assuming some initial function: void foo(std::string& src) { src += "some fixed string"; src += bar(); src += "some other fixed string";
3
17739
by: Hadar | last post by:
Hi, I'm trying to dynamically set the src of an iframe with the <% %> block: <iframe id="content" src="<% = Request.QueryString.Get("content") %>" width="100%"></iframe> Notice that the tag (intentionally) has no runat=server and also nested in a <TD> tag... What am I doing wrong?
5
1883
by: ad | last post by:
I find there are some tag like <%= %> and <%# > in my .aspx file. What is the diffreence between <%= %> and <%# %>
0
1001
by: Haffe | last post by:
I'm trying to get something back from a server. The communication between is XML. But I can't make it work. My asp.net code (doesn't work!): Dim requestText, serverResponseText As String Dim xmlServerHttp As New MSXML2.XMLHTTPClass
3
2758
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed into a <xml> document but not sure which direction to take. Is there perhaps a starter document which uses sql server as the data source I can tap into.
8
1359
by: active | last post by:
I use quickwatch on (astrThisOne <> "") and it reports: False as it should because astrThisOne reports: "" Yet If (astrThisOne <> "") Then executes the Then clause
10
2420
by: Dia | last post by:
At the company I work job applicants are required to do a little test. The human resource manager recently had a candidate who claimed one of the questions was ambiguous. Dependent upon the version of DB2 one or the other answer of a multiple choice question could be right, the candidate said. The HRM asked me to look into the matter, but since I am no expert in the workings of DB2 I submit the question to you hoping any of you can
17
4843
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This Page Is Valid XHTML 1.0 Transitional!" but it still wouldn't look the same. It is on http://www.dvdnowkiosks.com/new/theproduct.php scroll down and recognize the black bottom bar when you go ewith firefox(2.0) which isn't there with IE7. Why does...
3
3367
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.