Coding questions

Another question (is that shouts of joy I hear in the background? :D), aimed at anyone who knows the answer, but I suspect Harry will probably be that one.

I'm creating a personal blog, generally because I can and fancy doing so. I've got a first design ready and I'm happy enough with it to start building it and get it online.

However, I'm looking to implement sidenotes. I've had a look at how Harry has done it (on Web Design+) as I remember he did something similar and he's gone with having them in the same div, but moving them to the left with absolute positioning.

Is that the best way to do it? I'm assuming so as Harry has done it :p but I thought I best check, afterall I might learn something.

I guess the reasoning behind that method is for screen readers, so that sidenotes will be read and then the content.

Any recommendations welcomed :D
 
Yeah, you need to write the code in the order it should be read. You could have a sidebar div placing it next to it visually, but that's not correct from a logical point of view. Absolute positioning. Look at lines 202 and 208 of my CSS.
 
Cheers Harry.

I had a look at that through firebug and had a go at trying it out yesterday but it didn't quite work.

When trying to move 'left:-200px;' or whatever it moved it 200px from the left side of the screen, not its current position.

p.margin { position:absolute; left:-20px; width:200px; }

That's what I've got currently, not sure why it doesn't work as planned but I'll look into it.

EDIT: Hmm, it looks like I need a mixture of position:absolute and position:relative. I need it to be relative to it's current position but still make the paragraphs around it ignore it, so that they format as per usual and close up the gap left by moving this paragraph left..
 
instead of:

/* Cross browser reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}


wouldn't :

*{ margin:0; padding:0; }

be adequate to globally remove ALL default margins and padding? they can then be specified on each style as required.
 
Nope. That's an example of a bad reset. You don't want to remove margins and padding from everything. Imagine removing all the margins from radio buttons…
It also puts unnecessary strain on the UA, making it apply additional CSS to every single element on a page.
 
Yeah that's what I was trying to say before my internet said it wouldn't let me reply :)

Cheers for the info about the margin malarky Harry, I'll try it soon.
 
Right, working on getting the http://xenonsoft.co.uk to redirect to http://www.xenonsoft.co.uk.

At the moment it redirects to www but gives a redirect loop error on pages other than just the domain itself.

By that I mean http://xenonsoft.co.uk redirects to http://www.xenonsoft.co.uk fine but http://xenonsoft.co.uk/blog gets a redirect to http://www.xenonsoft.co.uk/blog and then gets a redirect loop error.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.xenonsoft\.co\.uk [nc]
RewriteRule ^(.*)$ http://www.xenonsoft.co.uk/$1 [R=301,L]

Originally nicked from Jaz so any help with this would be appreciated.
 
Still haven't got this sorted as I've been doing other things, will look at it later :)



A different problem currently though, not sure if any of you will know the answer mind.

I'm trying to burn our RSS Feed with Feedburner.

It keeps coming up with the error that it's either larger than 512kb (certainly not) or that it's not valid, or finally that it's not the right URL, which I'm sure it is as when you go to the feed manually it works..

The link is:

Blog - Xenonsoft Studios | Essex Based Web Design

EDIT: Also I'm not sure why it's showing just the summary, rather than the whole post each time as I've specified in the settings :confused:
 
Another quick question, I could write a book with these.

I'm validating the contact page of the site and it says I should specify how many rows and columns I want for the textareas.

I don't really want to specify as we're not looking to limit them, is there a way to put something like rows="any" (in a more technical way) to get past this?
 
Or if you prefer to use CSS to control the width and height just declare in your (x)html rows="" cols=""
 
Yeah I was assuming he was gonna use CSS to control width and height. I'm amazed rows/cols still exist as attributes—they're pretty presentational IMO.
 
Well I've used CSS to control width, but the validator made a point of telling me I need rows and cols too.

I just did your little test Harry and noticed no change at all, what was supposed to happen?
 
Xenonsoft said:
Well I've used CSS to control width, but the validator made a point of telling me I need rows and cols too.

I just did your little test Harry and noticed no change at all, what was supposed to happen?

That's the point. It's an attribute which controls width/height if/when styles are disabled. The CSS overrides these.
 
Back
Top