Diosyntaxa Posted May 3, 2006 Share Posted May 3, 2006 Ok, I wasn't quite sure where to ask about this but since I THINK it's mostly related to css, I'll try here.OK, here's the problem.I wanted to use a border for the links in a menu and also wanted the links to be the same width regardless of the length of the actuall text. #menu a { border-style: outset; width: 100%; padding-top: 1px; padding-bottom: 1px; } Now, the funny thing is, while it didn't work for my xhtml, it did work when I used the same css for a page that used the exact same xhtml inside an xslt-document!Also, it seems those 2 documents iterpret the css differently in other ways as well. While the xhtml didn't implement my width-setting, it looked good otherwise, but the container-div in the xslt-document is somewhat narrower, despite the actuall content on the page being exactly the same. Also, setting the width for the links (regardless of width really) actually made the impact of extra padding of the second link greater (I needed to pad a bit extra due to the out/inset-style border).I guess it might be better if I included a link as I'm not very good at explaining the problem http://thedcspirit.no-ip.org/davidxml/index.htmThe links that actually work are the ones labeled as Titles and Start page.As you can see, the 2 pages don't display the same way at all!Any help is appreciated, and if I posted this in the wrong place, just point me in the right direction and off I go Link to comment Share on other sites More sharing options...
SillyBilly Posted May 3, 2006 Share Posted May 3, 2006 Ok, I wasn't quite sure where to ask about this but since I THINK it's mostly related to css, I'll try here.OK, here's the problem.I wanted to use a border for the links in a menu and also wanted the links to be the same width regardless of the length of the actuall text.#menu a { border-style: outset; width: 100%; padding-top: 1px; padding-bottom: 1px; } Now, the funny thing is, while it didn't work for my xhtml, it did work when I used the same css for a page that used the exact same xhtml inside an xslt-document!Also, it seems those 2 documents iterpret the css differently in other ways as well. While the xhtml didn't implement my width-setting, it looked good otherwise, but the container-div in the xslt-document is somewhat narrower, despite the actuall content on the page being exactly the same. Also, setting the width for the links (regardless of width really) actually made the impact of extra padding of the second link greater (I needed to pad a bit extra due to the out/inset-style border).I guess it might be better if I included a link as I'm not very good at explaining the problem http://thedcspirit.no-ip.org/davidxml/index.htmThe links that actually work are the ones labeled as Titles and Start page.As you can see, the 2 pages don't display the same way at all!Any help is appreciated, and if I posted this in the wrong place, just point me in the right direction and off I go <{POST_SNAPBACK}> This post does not answer your question, but points out a grammatical error in your text. for whomever might be interested.The entire clause "whomever might be interested" is the object of the preposition "for". The clause must have a subject in the subjective case. In your clause the subject should be "whoever", otherwise you have the subject of the clause in the objective case. Link to comment Share on other sites More sharing options...
Little Goat Posted May 3, 2006 Share Posted May 3, 2006 try setting the width of the li elements instead.LGEdit: by the way, where did you get the image? I'd like something like that for my site (if I ever get one). Link to comment Share on other sites More sharing options...
Diosyntaxa Posted May 3, 2006 Author Share Posted May 3, 2006 try setting the width of the li elements instead.LGEdit: by the way, where did you get the image? I'd like something like that for my site (if I ever get one).<{POST_SNAPBACK}> Well, that didn't actually do it, but thanks for the tip anyway :)What really gets me though is the way the actuall width of the container is different even when I leave the xhtml in both files the same.. That doesn't really make much sense does it? They should look the same.As for the image, I found it here http://www.notepad.org/Enjoy Link to comment Share on other sites More sharing options...
boen_robot Posted May 3, 2006 Share Posted May 3, 2006 Are you sure the XSLT has exactly the same XHTML code? Could you post a link with some XML file that uses it... that's a really odd case in my opinion. It might be a browser bug or... who knows. The only issue with "same XHTML, different with and without XSLT" I have came across is when you use <xsl:comment> in the <style> tag to hide the CSS "for old browsers". It works when the page is parsed with a server side script(scince then you get the XHTML), but when processed on the browser side, it hides the CSS completely, thus it doesn't apply it (IE is THE only browser which doesn't have this behaviour). Link to comment Share on other sites More sharing options...
Jonas Posted May 3, 2006 Share Posted May 3, 2006 I don't know so much about xml/xslt, but for the links to be the same width/height, I think you have to use the cssdisplay: block;on a side note, I like to use this image:http://www.home.no/jvelde/example/ <-- Lots of 80x15 icons. Link to comment Share on other sites More sharing options...
Little Goat Posted May 4, 2006 Share Posted May 4, 2006 ok, back an element. set the ul's width.oh, and by the way, jonas, you need to do something about your directories being open to everyone.LG Link to comment Share on other sites More sharing options...
Diosyntaxa Posted May 4, 2006 Author Share Posted May 4, 2006 ok, back an element. set the ul's width.oh, and by the way, jonas, you need to do something about your directories being open to everyone.LG<{POST_SNAPBACK}> Thanks, but no need for that anymore, the display:block thing jonas mentioned did the trick :)The 2 pages still have different widths but the links are the same width, except for the last one on the other page, and only in ie. It looks ok, not perfect, but ok.In the end however, I may end up redoing the whole menu thing anyway. This whole thing is really an experiment to see if I can help a friend of mine understand his assignment.. All the better if I can learn a few things along the way! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now