HTML - Limiting The Pixel Length Of A String
Ok I know this isn't really a HTML issue, but to avoid complex clientside pixel-counting of fonts I've thought of something far more simple. I need to limit the length of a string to stop it wrapping. The first step is to limit the string's length in characters, using the following php script:
PHP Code: function trim_string($string) { $trim_string = '...'; $chars = 55; $chars_adjusted = $chars - strlen($trim_string); if (strlen($string) > $chars) { $string = substr($string,0,$chars_adjusted); $string .= $trim_string; } return $string; } Fine, no problem. Now however the strings are not all of equal length because of differences in length of each character (see the warmdebate.com homepage for my debacle). I thought that a relatively simple solution would be to simple use some sort of CSS or HTML wizardry to stretch the trimmed string to a fixed length (like full alignment, only for a non-wrapped string). Since this doesn't involve pixel counting or anything like that I figure it should be doable in CSS or HTML. Also, if there are any standard solutions to this other than what I'm proposing please let me know! Similar TutorialsHi there, I am currently building a website in dreamweaver. It's going slow but so far I have overcome ever problem with the help of people like you! The problem I'm at at the moment is pretty tricky. If you visit. http://aquariusspa.co.uk/flw%5Fver2/flw_ver2.html This site I built with photoshop and then exported as html. Now i'm adding content and the nav bar (which isn't quite working right!). So what i'm looking to do is have the main box (one with welcome in it) change height depending on what i enter in to it. Every page has different amount of text. Now I could just build every page in photoshop for the desired page height but surely there must be a way of stretching what i've got with out wreaking the graphics. Thanks in advance. S Hello, Thanks for taking a look at my question. I am in the beginning stages of setting up a site for a client and am running into the three pixel text jog problem with ie. Can anyone please take a look at my code and help me resolve this? Thank you for your time in advance. Thanks, Steve site: http://homepage.mac.com/stephenjames...ogh/index.html css: http://homepage.mac.com/stephenjames...s/ogh/main.css I am trying to create menu based website for cars, how to I limit a menu to include only the models for a certain make. If ford is selected I want to be able to select mustang, taurus and f150, but not accord, because accord is made by honda. I am using Make: <select name="Make"> <option value="0">Acura</option> <option value="1">Audi</option> <option value="3">Bently</option> <option value="4">Ford</option> </select> format to create my menus, any reference to a page explaining how this would be helpful as well as defining (proper terminology) what I am trying to do. TIA, James Hi everyone, I'm new one and I need same help. And sorry for my English. I'd like to make html site with QuickTime to limit download. I simple html look like that: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> <title>quicktime</title> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" alink="#FF0000" vlink="#000080"> <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="320" HEIGHT="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab";> <PARAM name="SRC" VALUE="MyMovie.mov"> <PARAM name="CONTROLLER" VALUE="TRUE"> <PARAM name="AUTOPLAY" VALUE="TRUE"> <PARAM name="CACHE" VALUE="FALSE"> <PARAM name="QTSRC" VALUE="http://IP:8080/film.mov"> <PARAM name="QTSRCDONTUSEBROWSER" VALUE="TRUE"> <PARAM name="QTSRCCHOKESPEED" VALUE="movierate"> <EMBED src="MyMovie.mov" WIDTH="320" HEIGHT="256" CONTROLLER="TRUE" AUTOPLAY="TRUE" CACHE="FALSE" QTSRC="http://IP:8080/film.mov" QTSRCDONTUSEBROWSER="TRUE" QTSRCCHOKESPEED="movierate" TYPE="video/quicktime" PLUGINSPAGE="http://www.apple.com/quicktime/download/";> </EMBED> </OBJECT> </body> </html> And it works, but I want to do this not with .mov files but with .wav files. I'm trying to change that script but it's not working well. Thanks and regards. Kamil. Hi all, im working on a project that requires me to show live feed from an ip camera. I have already created an iframe, now the problem is i want to limit some stuff from the users. Is there a solution to this? please help! i'll attach an image to this post. Thanks alot. * the area highlighted in red is what i want to remove. Greetings, I am trying to prevent the my window from scrolling from side to side and up&down. You can see in my image that the frame has excess information to the right of the screen. I cannot tell if this is b/c of the images or if the problem is in the code. Here is the current code for the page. <!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>The works of D.M. Rosemark</title> <style type="text/css" media="screen"> <!-- body { background-color: #ffffff; margin: 0px } #horizon { color: white; background-color: transparent; text-align: center; position: absolute; top: 50%; left: 0px; width: 100%; height: 1px; overflow: visible; visibility: visible; display: block } #wrap {margin: 0px auto; width: 1273px; } iframe.one { width: 600px; height: 375px; border-style:ridge; border-width:10px; border-color:#999999; padding:1px; float: left; display: inline; //--> </style> </head> <body> <div id="wrap"> <img src="topbanner.jpg" alt="Top Banner" style="width: 1260px;"><div id="innerwrap"> <img src="leftimage.jpg" style="float: left; width: 325px;"> <iframe class="one" frameborder="0" src="01.html" scrolling="yes"> </iframe> <img src="rightimage.jpg" style="float: left; display: inline; width: 325px; "></div> <img src="bottombanner.jpg" alt="Bottom Banner" style="width: 1260px;"></div> </body> </html> Thanks in advance!! D.M. Rosemark OK, so I have a dynamic table that can be filtered. The full table has just over 250 rows. My problem is that even by setting their display property to 'none', it still causes the rows to take up what seems to be a pixel of space. So, if several consecutive rows are hidden, it causes noticeable white space to appear and it can make it look really bad. In some cases over 100 consecutive rows are hidden and it causes a very large blank space to show. Oddly, I ran into this problem only when working in Firefox. It performs fine in IE. Here are some captures. Take note the number in the SEQ column shows what row it is: Before being filtered: After being filtered in IE: After being filtered in Firefox: I can't find anywhere else online where anyone has even had this particular problem. Can anyone help? I'm stumped. One possible solution I thought of was absolutely positioning all of the display:none rows on top of each other but I didn't know if that could work or not. Huge thanks to anyone who has a solution. I can post the JavaScript for the filtering if anyone thinks it may help. Hi. I have a very discrete light blue color in the background from a previous template. It ends about halfway through the bottom area and I'd like to extend it throughout the entire page without moving/overwriting anything else please. www.movehumanityforward.com Thank you hi, I have this:<form > <input id="Email" maxlength="40" name="Email" size="40" type="text" value=""><br /> <input id="pwd" maxlength="40" name="pwd" size="40" type="password" value=""> <label for="Submit"> </label> <input id="Submit" name="Submit" type="submit" value="Submit"> </form> In Safari and Firefox, the two boxes look the same length, you can see from diff_ff.jpg, but in IE, it looks different(please see diff.jpg), if I change "password" to "text" they will look the same in length, any solution to this? Thanks, A.C. Please take a look at this page: http://lifeengineering.org/ Try out the menu links and see what I'm talking about. The "short" pages shift horizontally. In other words, if the div block with the content doesn't reach the bottom of the browser window, then it's rendered in a different horizontal position. So, changing the pages through the menu makes the pages appear to "jump". NOTE: You'll need a reasonably big resolution to see what I'm talking about (e.g. 1152 x 864+). Any suggestions on how to correct this? Is there a way to pad blank spaces at the end of my content in the div block to ensure that it always reaches the end of the browser window? Or something similar? ------ Issue #2: My background isn't ideal. I like the rainbow, but I'd like to change it. If I wanted to make the rainbow arc appear stationary as I scroll the page (i.e. to have the upper left arc of the rainbow always appear on the upper left corn of the screen), how would I do it? Any other suggestions, artistically, with respect to the page background? Thank you kindly! This is one of these things where you probably should just go to bed and forget all the confusion. My question: How the heck can you specify the length of the option field for a drop town list? I am sure ther is an embarrasingly simple answer. Thanks a lot and good night! Hi All, Is there any maximum length for tooltip for html tags? How can I determine the possible max length? Rahul.... hello, new member here so hiya! I have a site and I have a div containing all the page. At first I gave it a height just so I could put CSS in and see what it's like. After I have taken out the height though, the div shrinks to like 1 pixel. Why isn't it as long as it's containing divs - including left column, main section, footer? Many thanks I have a menu made up of one div and within that div are more divs to make up the separate menu items. I am trying to add a background colour to the holding div but it's not having any effect. When I investigate the div order in web developer it shows that it's not extending to the height of the menu divs inside it. Please help. It's menu_nav I am trying to put a background on. HTML: HTML Code: <div id="menu_nav"> <div class="mainMenu"> <a href="#">HOME</a> </div> <div class="mainMenu"> <a href="services.html" onmouseover="mopen('servicesSub')" onmouseout="mclosetime()">SERVICES</a> <span id="servicesSub" onmouseover="mcancelclosetime()" onmouseout="mclosetime()"> <a href="#">Website Production</a> <a href="#">Hosting & Domains</a> <a href="services.html#design">Design & Branding</a> <a href="video.html">Video Production</a> <a href="#">Interactive Media</a> </span> </div> <div class="mainMenu"> <a href="portfolio.html" onmouseover="mopen('portSub')" onmouseout="mclosetime()">PORTFOLIO</a> <span id="portSub" onmouseover="mcancelclosetime()" onmouseout="mclosetime()"> <a href="portfolio.html#websites">Websites</a> <a href="portfolio.html#programs">Programs</a> <a href="#">Video</a> <a href="#">Animation</a> <a href="#">Design</a> <a href="#">Web solutions</a> </span> </div> <div class="mainMenu"> <a href="info.html" onmouseover="mopen('aboutSub')" onmouseout="mclosetime()">INFO</a> <span id="aboutSub" onmouseover="mcancelclosetime()" onmouseout="mclosetime()"> <a href="prices.html">Prices</a> <a href="sitemap.html">Sitemap</a> <a href="aboutUs.html">About Us</a> <a href="contact.html">Contact</a> </span> </div> </div> CSS: Code: * MAIN MENU NAVIGATION*/ #menu_nav a, #servicesSubMenu a { text-decoration:none; color:black; } #menu_nav { width:950px; background-color:#E6E6E6; height:auto; margin-top:0px; font-size:11pt; margin:auto; } .mainMenu { float:left; float: left; margin: 0px 75px 0px 75px; background-color:#E6E6E6; line-height:30px; } .mainMenu a { line-height:20px; display: block; font-size:11pt; text-align: left; text-decoration: none; background-color:#E6E6E6; } #menu_nav a:hover, #footer a:hover, #left_menu_column a:hover { color:RGB(5,127,204); } /*DROPDOWN MENU*/ #servicesSub, #portSub, #aboutSub { visibility:hidden; position:absolute } #servicesSub a, #portSub a, #aboutSub a { width:150px; border-bottom:1px solid white; color:grey; padding-left:4px; padding-right:4px; padding:5px; } The adage of 'give a man a fish and he'll be fed; give a man Dreamweaver and he thinks he's a designer' is alive and well with these glitches. http://www.zenarchy.co.uk/test11.htm is a design draft and there are two problems. The first is that the central span that houses 'High quality call recording software' doesn't match up to the end and sit flush. It's almost there in firefox but is miles off in IE. I'd like it to work in both. <td width="100%" height="22" bgcolor="#91a2a0"> <p align="center"><b><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>High quality call recording software</strong></font></b></td> is the code I've identified as relevant, but opening the hood and checking the source might be wiser! 2. How do I extend the columns on either side to sit flush at the bottom against the graphite baseline? Your thoughts please (aside from get a pro to do it...) Cheers! hi My code is- <HTML> <HEAD></HEAD> <BODY> <TABLE> <TR><TD> <SELECT NAME="Date"> <OPTION>1</OPTION> <OPTION>2</OPTION> : : <OPTION>30</OPTION> <OPTION>31</OPTION> </TD></TR> </TABLE> </BODY> </HTML> it will show the numbers from 1 to 31 in the drop down with long scrollbar. My problem is - I want show only 10 numbers.User need to scroll and select other numbers. Is it possible? Hi, I'm writing a website using tables (0 border and space etc.) so that things don't move around on different computers and browsers. However, I've run into a bit of trouble with a particular cell. The one in questions is my navigation menu. I have it written in php as a separate page and used the include tag to load it onto the index. It consists of a table of height 600 and a single column with a couple of cells. Now, from my reasoning, the the 600 table height of the nagivation menu/page should easily fit into the 600 cell height of it's space on the index. This is reflected when I view the page using IE - all of the border/frame images that I had made went together perfectly. However, when I view the page with FireFox, the navigation menu seems to be too short in that the first navigation cell does not immediately appear after the top border line. There is a blank white space. Also, it seems to have stretched that particular row because the right most border on the index, which is not connected to anything else and is it's own image, is centerized so that there is white space left (indicating the cell was incremented height wise). Does anyone know if this is a fixable discrepancy? A link to the test page is: VA Test Page I can provide a link to the menu page if it's needed... Anxiously awaiting a reply whether it's related or not How do I figure out the lenght of the page (content, not browser window) so that I can make all of my regions line up at the bottom? I noticed that % in the height attribute is related to the window not content. I have also tried auto, but that is different for different content. My page has an outside region, a left nav bar and a content region, and I don't know how to make the bottom line up without tables. Sorry if this is confusing. Thanks in advance. I have a left menu column but it's not stretching down the length of the page. The page is quite long and when the links are finished on left column it just ends and as it has abackground colour it looks a little strange. It is floated left and the main_section is also floated left. It is the main section div that is long. I was thinking because this is in a div that the left coumn is also in that the left column would therefore stretch to the length of it's parent div. Any ideas? http://absolute-websites.com/services.html is the link so you can see what I'm talking about. Here is a section of the HTML : HTML Code: <div class="left_column"> <div class="breadcrumb"><p><a href="index.html">home ></a>services</p></div> <div class="icons"><p><a href="services.html#websiteProduction"><img src="images/webIcon-01.png" title="web building" alt="web building icon"/></a></p></div> <div class="icons"><p><a href="services.html#hosting"><img src="images/hostingImgIcon-01.png" title="Hosting & Domain Names" alt="Hosting & Domain Names icon"/></a></p></div> <div class="icons"> <p><a href="services.html#seo" ><img src="images/seo2Icon-01.png" title="Search Engine Optimisation" alt="Search Engine Optimisation icon"/></a></p></div> <div class="icons"> <p ><a href="services.html#marketing"><img src="images/advertsIcon-01.png" title="Marketing" alt="marketing icon"/></a></p></div> <div class="icons"><p ><a href="services.html#design" ><img src="images/designImgIcon-01.png" title="Design" alt="Design icon"/></a></p></div> <div class="icons"> <p ><a href="services.html#photo" ><img src="images/photoIcon-01.png" title="Photoditing" alt="Photoediting icon"/></a></p></div> <div class="icons"> <p><a href="services.html#video" ><img src="images/videoIcon-01.png" title="Video Production" alt="Video Production icon"/></a></p></div> </div> <div id="main_content" class="fl"> <h1 class="h1SecHead" >>SERVICES</h1> |