- This topic is empty.
-
AuthorPosts
-
February 17, 2012 at 7:26 am #36705
yasser1688
MemberThis is how my table code is shown when I view it using Firefox firebug.
I am using Razor with MVC and I am doing paging and these are links to pages.What I want to know is there any way I can give some css to add a special/seperate style to the number 7 (Note number 7 here is the current selected page and hence no link is shown)
OR is there any way I can add tag to this text using Javascript/jquery ?
Please any help is appreciated.
This is my first post here, so I am really sorry if I have not followed any rules/conventions for writing a post.
Thanks in advance
YasserFebruary 17, 2012 at 7:48 am #96877Zeriz
MemberNot sure if I understand the question 100%, but from what I can see you know what a class and a id is – but it always helps to refresh your mind about the basics.
An ID can only be used once in a document, and a class selector can be used as many times you’d wish to. And if you give that number seven a unique ID you will be able to style it like you want.
7
February 17, 2012 at 7:56 am #96878yasser1688
MemberHi Zeriz,
Yes I know, but the thing is this html code is generated by the MVC Razor engine and not by me, I am just trying to implemented css here,
Is there any way I can do this ?
OR any way in which I can add an HTML tag to this text dynamically using jquery or javascript
February 17, 2012 at 8:03 am #96880Zeriz
MemberI’m sorry, I have less experience with the MCV Razor engine, so I’m not sure if I can help any further now that I see what the real problem is. I guess you could make jQuery search the documents for the id “#footer”, and make it go to the 7th a-attribute to give it an unique ID – but that sounds like a very clumsy way to do this.
I think you should look for the code part that processes this HTML to the document and see if there is any possibility to give it an unique ID from there. :)
February 17, 2012 at 1:46 pm #96897monk18
MemberYou can use jQuery. In jQuery you ‘ll have the ability to select a specific child. These links should help you.
http://www.mkyong.com/jquery/jquery-nth-child-selector-example/
https://css-tricks.com/how-nth-child-works/
https://css-tricks.com/useful-nth-child-recipies/February 20, 2012 at 1:25 am #96989yasser1688
MemberHI Monk18,
Thanks for your reply. I have seen the links you posted. But in my case the child will keep on changing.. is there any way to check which child is not surrounded by any tag and then surround it by some tag ?
February 20, 2012 at 6:10 am #96998yasser1688
MemberYes, I did try that and I was some what successfull too but now only thing is that the spacing problem still persists.
Here is the screenshot : Link to screenshot…
I know I am close to it, please one more hint and I am there
Thanks in advance :)
February 20, 2012 at 7:51 am #97014yasser1688
MemberWorked like a charm !!!!
I love this forum
Thanks senff. Made my day!
January 7, 2013 at 12:41 am #120059arun7331
ParticipantAlso you can check this link for a pure css dropdown menu. I don’t see any client script written in there and it looks good. But there is a problem. It performs differently in a firefox browser.
http://www.encodedna.com/2013/01/css-animated-dropdown-menu.htm
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.