- This topic is empty.
-
AuthorPosts
-
August 11, 2013 at 1:29 pm #146416HamedParticipant
Hi, i want to have 4 blocks of divs:
-# main size specified
-# one size specified
but #two with content 1 must stay beside of #one ( not over it! )
and #two with content 2 must have 100% of width… here is the code:#main { display: block; margin: 0 auto 0 auto; width: 800px; height: 1000px; border: 2px solid black; } #one{ display: block; float: right; width: 200px; height: 400px; border: 2px solid blue; } #two{ display: block; float: left; width: 100%; height: 400px; border: 4px solid red; margin: 0 0 10px 0; }
< div id = “main” >
< div id = “one” >sidebar< /div >
< div id = “two” >content 1< /div >
< div id = “two” >content 2< /div >
< /div >is it possible?
August 11, 2013 at 1:38 pm #146418Paulie_DMemberHave you tried making a Codepen?
August 11, 2013 at 1:45 pm #146420HamedParticipanthttp://codepen.io/anon/pen/defnG
i don’t know why # two come over # one or push it down!August 11, 2013 at 1:51 pm #146424Paulie_DMemberYou can’t use the same ID on two elements.
You might want to look into that….oh, and a clearfix as well.
August 11, 2013 at 1:55 pm #146426HamedParticipantthanks for you reply
do you see google plus post format?
2 of posts is in half size 50%-50% and one of them have 100% width
it’s must to be like that…
here is a image of what i want:http://d.pictureupload.us/13197628025207f9ff225f3.jpg
it’s so important for me to have one id for two elements…
August 11, 2013 at 1:56 pm #146428chrisburtonParticipantLike this? http://codepen.io/chrisburton/pen/lGcvs
August 11, 2013 at 1:58 pm #146429Paulie_DMemberit’s so important for me to have one id for two elements…
It’s still wrong…you should be using classes instead.
August 11, 2013 at 1:59 pm #146430HamedParticipantAugust 11, 2013 at 2:13 pm #146431chrisburtonParticipant@Hamed Paulie is right. Why is it important for you not to change the markup?
August 11, 2013 at 2:16 pm #146432HamedParticipantcoz it’s a blog post loop and gonna be repeat for every post…
can’t we do it with jquery or somethink?
any idea? please…August 11, 2013 at 2:20 pm #146433chrisburtonParticipantSo you need to change your loop code, then.
This is how I’d do it: http://codepen.io/chrisburton/pen/lGcvs.
The content that goes in
.main
would be the latest post and the rest would go in.secondary
.August 11, 2013 at 2:26 pm #146434HamedParticipantthank you chris but i have not access to loop code!
are you sure there is no way to do it?
any trick with css, javascript or jquery with if else or what ever ?
there is no way at all?
last hope :DAugust 11, 2013 at 2:35 pm #146435chrisburtonParticipant@Hamed What CMS are you using?
August 11, 2013 at 2:40 pm #146436HamedParticipantit’s a specific blog service and for me in unknown language… and forget it !
what if i use wordpress?August 11, 2013 at 2:45 pm #146438chrisburtonParticipantWordPress is all right. I prefer Kirby, though. Much more flexible and simpler to use from my experience.
But whichever you choose, I think it’s important that you have control over your output.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.