Log in

View Full Version : Resolved Drop down menu left/right position



theremotedr
05-17-2015, 09:20 PM
Hi,
On my web site each drop down list which flies out under each heading aligns itself left to right.
Looking at the heading Others,it also flies out left to right.
Can it be altered so it flies out and aligns itself right to left.

I ask because on the iPad half of it is unreadable.
Website http://www.theremotedoctor.co.uk/index.html

Screen shot from iPad supplied when screen is moved over,otherwise you only see what's is inline with the edge of the Others heading right hand border.

Deadweight
05-17-2015, 11:43 PM
html:


<a href="#">Others</a>
<ul class="xxx">


css:


.xxx{
left:-100%;
}

theremotedr
05-18-2015, 08:48 AM
Ive added the code shown above but something is incorrect.
Please take a look.

http://www.theremotedoctor.co.uk

Also error code page
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.theremotedoctor.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&st=1&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices

Beverleyh
05-18-2015, 05:20 PM
The problem is that you now have two open <ul> tags;

<a href="#">Others</a>
<ul class="others">
<ul>

What Deadweight was indicating, was for you to make a modification to your existing markup by adding the "xxx" class. It wasn't so much a copy+paste addition, as a "make your markup look like this" instruction, although that might not have been obvious.

It's a little awkward for us (hardened coders) sometimes because we don't know how much knowledge the person asking for help has, and unless the poster specifically says that they're a beginner or that they use a point-and-click website builder, we often assume that the poster knows the rules of well-formed HTML markup and some CSS. Your post count, and the rank/label that goes with it, may work against you too in that respect (implying more coding experience).

Anyway, on this occasion, all that's needed is to remove the extra <ul>

theremotedr
05-18-2015, 05:42 PM
I have removed the <ul> but still the list flies out like before ?

theremotedr
05-18-2015, 08:45 PM
Unless i removed the incorrect <ul> there is no change even after adding the code advised.
Checking for any errors shows nothing wrong,so i am lost as to why the list does not fly out the opposite way.
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.theremotedoctor.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

Deadweight
05-18-2015, 10:59 PM
Sorry I took a screenshot this time:
http://i1151.photobucket.com/albums/o640/d3adw3ight/Shot029.png (http://s1151.photobucket.com/user/d3adw3ight/media/Shot029.png.html)

theremotedr
05-19-2015, 08:51 AM
Hi,
Thanks for the screen shot but not quite able to see it properly.

I think what i can see ive now added to my page and the drop down list is now reversed but have some yellow mark ups.
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.theremotedoctor.co.uk%2Findex.html&charset=%28detect+automatically%29&doctype=Inline&group=0&st=1&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices

Please take a look & advise so i can edit the other pages and mark this as resolved.

Beverleyh
05-19-2015, 09:48 AM
For the first validation point - a warning: Here is more information on what a BOM is and how to remove it: http://www.w3.org/International/questions/qa-byte-order-mark.en.php

For the second validation point - an error: Look at your markup that has been flagged by the validator;
<ul style="left: -100%;">
</li> <--- a closing list tag... but what about the opening one?
<li class="current"> <--- an opening list tag... but the list item it empty... where should the closing tag be?and compare it to a well-formed HTML list (you can probably compare to lists elsewhere on your page to look for patterns <--- big tip right there - a lot of successful troubleshooting comes down to being able to identify patterns). The official W3C list specifications can be found here with examples: http://www.w3.org/wiki/HTML_lists Look over the full page but specifically under the 'Nested List' heading for further advice on how to create a nested list, which is what most complex navigation systems use. Indenting the <li> elements (tabs, spaces, your choice) according to how deep they are will help you see the structure more clearly. Also, some HTML editors, such as Notepad++ will create collapsible code blocks to help you see paired opening and closing elements (helpful when troubleshooting nested lists that have gone awry).

The third validation point is another warning, so it's up to you whether you fix it or not. The recommendation is to add a heading to that section, so search the web page doc for <section id="content" class="wide-content"> (the flagged section) and decide if it is appropriate to insert a heading there using the h2-h6 tags.

theremotedr
05-19-2015, 09:57 AM
<li><a href="#">Others</a>
<ul style="left: -100%;">
</li>
<li class="current">

So the correct thing to do is delete the </li>

Beverleyh
05-19-2015, 10:04 AM
That's something you can check with the validator. Does removing the </li> tag fix the validation error? ;)

theremotedr
05-19-2015, 10:12 AM
Are you a head teacher, ha ha.

Yes it does,but no harm in asking.
Using the link you advise i was also told no language attribute was assigned.
So i will now add
<meta http-equiv="Content-Language" content="en" />

theremotedr
05-19-2015, 10:15 AM
Forget the above regarding en code

Beverleyh
05-19-2015, 10:27 AM
You can specify the language on the <html> element - like this;
<html lang="en">

Ha, I have my exam invigilator head on today because of the IT exams taking place next door. :D

theremotedr
05-19-2015, 10:32 AM
I have done it before this message came through.

Cheers.
Quick question without looking at every page.
The BOM is only on the index page ?

Beverleyh
05-19-2015, 10:45 AM
It could be something that has been introduced while working in code view, or from changing the save settings. Sometimes an editor will attempt to identify code and choose the encoding type for you without you realising, so if you've added a snippet of code from a forum for example, the editor might identify something in that 3rd party code and go "looks like we've switched to unicode (or whatever) - I better save the page with different encoding".