Wednesday 16 December 2009

How do you get Fiddler to look at local traffic?

This is a neat trick that I was unaware of until the other day. Have you Fiddler to look at your web traffic? Fantastic tool right? You can get it here http://www.fiddler2.com/fiddler2/ it is free debugging proxy.

Anyhows... I wanted to test some local web development but to my frustration initially it like you cannot debug this local traffic. You can though, simply use http://localhost./ instead of http://localhost/ in your addressing and bingo... cool huh?

Sunday 13 December 2009

How do you get Firefox to show HTML LI list items like IE?

Earlier this week I had a web page that would not render quite properly under firefox, it had a list of bullet points that were in fact placed inside a TD cell and it just looked like the bullets were not centered in the cell.

Embarassingly enough I cannot remember the precise code to reproduce the layout here, which if I get some time will give you a code sample so you can see what happened. I initially though I could solve the problem using appropriate padding and margins for just Firefox but I'm pleased to say rather than using that hack I spotted the real problem.

For whatever reason, and I don't know if IE or Firefox is at fault I noticed that the IE list items had a property of list-item-position set to inside - where as Firefox was set to outside. Changing my firefox stylesheet to use list-item-position:inside solved the problem!

IE8 float issue with ASP .Net User Control

I had a new float issue appear the other day and whilst easy to solve was a bit of a pain to find! It was unique to IE8 in that IE 6, 7 and Firefox behaved whilst 8 didn't. I had two floats on a two column page and the left float would appear underneath the main content in IE8.

I discovered, if you happen to have a similar problem, that one of the user controls that was being processed on this page was wrapped within <FORM> tags - yet it wasn't a form to be processed, it didn't have an action - the parent master page itself had form the processing origanised. Once the FORM tags were removed from the user control IE8 then behaved itself. Hope this helps if you come across this problem!

How do you write HTML to appear in your blog?

Now and again, especially if writing about code you will want to display an example of source code in your blog, and if you are writing about HTML you may want to display some tags. If you are using Blogger, or mny other blogging tools it is likely instead of showing you HTML example the blog software will process the tags and render the output rather than displaying the code. How do you get round this?

Two things, first and most simply for any source code use the <code> tags.

function foobar(){ return true;}

Second, more especially for HTML use the following &lt; for < less-than symbols and use &gt; for all > greater than symbols. This will allow your source to appear on the page and not get processed:

<table>
<tbody>

etc etc...

How do you get a HTML table TD cell to wrap consistently?

I have just had some fun working with a HTML table. I just a table with five cells each of which I had initially set widths on each TD element. When the data for each cell was less than the predefined widths everything displays fine but as soon as the data exceeds the width I found the cell sometimes wrapped but usually kept the table expanding (The data I was trying to get to wrap was a URL - so just a continuous string without spaces) I think had the data included spaces the mishaped table would not have been so bad.

The solution I found was to embed a DIV within each TD that I wanted tied to a specific width - and within the DIV style or CLASS set a width explicitly. This found kept the table aligned!


<table>
<tbody>
<tr>
<td width="100px">
</td>
<td width="200px">
<div>class="widthclass" OR style="width:200px">
data....
</div>
</td>
</tr>
</tbody>
</table>

How do you get CPanel to create an email account that works with Outlook?

I have been using Cpanel on a number of hosts for a while now and had never had any problems. I have a domain, want an email address, just create a new account and set a password. CPanel then lists the details that need to connect via an email client and you are away.

Although I have noticed the details CPanel give you back are slightly incorrect, such as the user name appearing as name+domain rather than name@domain - but easy to rectify none the less.

Unfortunately the last account I added didn't connect from the client - it worked from the webmal link but not my outlook client. Annoying very annoying!

The solution, in this case was to reset my password making sure that all the characters used were lower case! What a pain that was, especially since you expecially when I expected the issue to be related to server names, ports or that kind of stuff!

If you are having problems give this a try....