473,379 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

calculating width

I have a span that has a width of 25%. I want to use that span as the
top of a dialog box that has rounded corners. So, the span itself is
broken up into 3 smaller spans, one for the left and right corner
images, and one that stretches in between.

<span id="dialogTop" style="{width:25%;}">
<span id="dialogTopLeft" style="{width:6px;}"></span>
<span id="dialogTopMiddle" style="{width:(25% - 12px ???);}"></span>
<span id="dialogTopRight" style="{width:6px;}"></span>
</span>

I know that the left and right spans need to be 6px each. What I need
to do is define the width of the middle bit as being 25% - 12px. Is
this at all possible?

Thanks
Martin

Jul 23 '05 #1
1 1895
mpa...@qualtech-int.com.au wrote:
I have a span that has a width of 25%. I want to use that span as the top of a dialog box that has rounded corners. So, the span itself is
broken up into 3 smaller spans, one for the left and right corner
images, and one that stretches in between.

<span id="dialogTop" style="{width:25%;}">
<span id="dialogTopLeft" style="{width:6px;}"></span>
<span id="dialogTopMiddle" style="{width:(25% - 12px ???);}"></span> <span id="dialogTopRight" style="{width:6px;}"></span>
</span>

I know that the left and right spans need to be 6px each. What I need to do is define the width of the middle bit as being 25% - 12px. Is
this at all possible?

Thanks
Martin
Really a CSS, not a JavaScript, question. Might want to brush up on
inline (HTML) CSS notation first:
<span id="dialogTop" style="width:25%;">


Curly braces belong in HTML <style></style> blocks.

http://www.w3.org/TR/REC-html40/pres....html#h-14.2.2

A span is an inline element; you really need a box-level element for
this.

http://www.vertexwerks.com/tests/sidebox/

Jul 23 '05 #2

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

Similar topics

6
by: Conax | last post by:
Hi, Just wondering if there is a way in ASP, to calculate with of a string of text in pixels. The result is to be used to set table width so that texts don't get wrapped to second line. Thank...
25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
3
by: Lars G. Svensson | last post by:
As a regular ciwas reader, I learned that fixed-pixel designs are evil, so for the newly created site http://www.ddc-deutsch.de (in German, still very much under construction) I arranged the...
6
by: delerious | last post by:
These browser inconsistencies are starting to drive me crazy! Here's an Opera 7.22 bug I just found: When calculating an element's width using...
2
by: Axel Dahmen | last post by:
Hi, I've noticed a different render behaviour between FF and IE, and now I'm not sure how to handle this: <html> <body> <div style="width: 100%; padding: 30px; background-color:...
1
by: Nathan Sokalski | last post by:
I want to make a table of links on my page. However, because different users will have different screen widths, I will need to calculate the number of columns based on the screen width and width of...
7
by: Jeff | last post by:
Hey asp.net 2.0 I'm trying to calculate the width of the HyperLink control (see my code below). But all I get is the value 0.0 PlaceHolder placeholder =...
2
by: hgarg | last post by:
The onpaint() is getting called before calculating the required parameters by listBox1_SelectedIndexChanged function. I tried calling it at the end of this function. But of no use. Due to this issue...
21
ddtpmyra
by: ddtpmyra | last post by:
There's two text box that has to enter the the numbers from the user and below I want to display the total value the user inputed. How can I sum it up and have it displayed every they enter a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.