ysuran
Members
-
Joined
-
Last visited
Reputation Activity
-
Wynn has explained it pretty well, I if I wanted a floated inline block - maybe you have a background on it that you want to collapse to fit the content contained then you just create a parent, float it then give that element a child that can be given display inline-block.
-
ysuran reacted to Wynn in Max width/Min width issues on inline-block elementsFloated elements take on a computed value of display: block, so your inline-block on .contents is redundant and it's probably not acting as you expect.
http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo
So as a float is set to display block it will always take on the max-width value because its default is 100%.
Also see http://stackoverflow.com/questions/5331882/inline-block-min-max-width-behavior.
Inline-block elements are a little strange, they always produce a small gap (around 5px) on the right of the element. This is caused by the line-break in your html, it's not a margin and the only way to get rid is to inline your code, eg
<div class="contents"> .... .... </div><aside> ... ... </aside> you need to account for this small gap when positioning.
Personally I'd just stick with floats and use percentages for values.
Not sure that helps.
-
ysuran reacted to Wickham in Issue with div alignments and heightsBoth your methods will result in gaps where one block has more height than the one in col 2.
I used the page without the dispaly-table codes http://beta.poltairschool.co.uk/Parent/Staff.html
You could give all the divs in both columns a height suitable for the majority and a stlye of overflow: auto; This will create a vertical scrollbar only in the divs which need more height. Be aware that the vertical scrollbar may add to the width about 20px, so the widths may need looking at. The div style for .staffwrapper may need to be reduced below 45% to allow for some divs having a vertical scrollbar (I can't remember if it will add to the width or be included in the width). Edit: height: 170px and 45% width seems OK in my test.
CSS
.staffwrapper { height: 170px; overflow: auto; margin: 2%; width:45%; float:left; display:inline; border:1px dotted #BCBB9A; /*background-color:#F9FBF0;*/ } /* I guessed the height, make it suit a typical div block*/
HTML markup for a typical block stays the same:-
<div class="staffwrapper"> <div class="staffheader"> <div class="stfimage"><img src="/common/images/user.png" alt="Poltair Staff image" title="Miss S Hancock" /></div> <div class="stfname"><h4>Name:</h4><span>Miss S Hancock</span> </div> </div> <div><h5>Roles:</h5> <ul><li>Teacher of MFL</li> </ul><h5>Department:</h5> <ul><li>Modern Foreign Languages</li> </ul></div></div>
The vertical scrollbar will be a bit unsightly, but I can't think of another method except giving every block a height that suits the div needing most height which would leave gaps everywhere.
-
ysuran got a reaction from Jonathon Maguire in Php RedirectI'm sad enough to have studied CCNA twice
I might have misinterpreted what Shaun was trying to say. What I was asking is why $_SERVER["REMOTE_ADDR"] would only work with local IP addresses?
Wouldn't the following code which uses the start of a public IP work in the same way?
if(substr($_SERVER["REMOTE_ADDR"],0,3) == 216){ // do redirect here }
-
ysuran reacted to Skateside in JS ChildNodesAccording to the DOM spec, text is always held in a textNode. This means that your parent1 div doesn't have 3 children, it has 6. This is probably where your extra children are coming from. To get around this, we usually check the nodeType (a list of the types may be found here) so this piece of code may give you the 3 children you were expecting:
<script type="text/javascript"> function test() { var testing = '', childArray = document.getElementById('parent1').childNodes, i; for (i in childArray) { if (childArray[i].nodeType && childArray[i].nodeType === 1) { testing += childArray[i].className + "<br \/>"; } } document.getElementById('result').innerHTML = testing; } </script>
-
ysuran got a reaction from nuksies in It's BROKEN but I don't know why!Because you are floating .aboutside and .holder-general-secure you need to add a clear div after them for the page to flow correctly
<div id="sub-container"> <div id="breadcrumbs">...</div> <div class="about-side">...</div> <div class="holder-general-secure">....</div> <div style="clear:both;"></div> </div>
that extra div should solve the problem
-
ysuran got a reaction from idesignwebsites in Ajax Problem with removing and reinserting contentdamn you wanted to know how to fix it
i'm not totally sure of the best way to do that i'm pretty sure that placing an onclick="dosomething();" on the element may cause the same issue but try it first. The way I would do it if that doesnt work is to rebind the onclick events by calling a function in the ajax callback.
Something like this :
$(document).ready(function(){ bindButtons(); }); $.ajax({ url: "test.html", success: function(){ $('.images').contents().detach(); $('.images').hide().append(response).fadeIn('10000'); bindButtons(); } }); function bindButtons(){ $("#id").click(function(){ //do stuff }); $("#id2").click(function(){ //do stuff }); }
There is probably a nicer way of doing this hopefully someone else might be able to suggest something
-
ysuran got a reaction from idesignwebsites in Ajax Problem with removing and reinserting contentDid you get this working by calling the function in the $(document).ready? I'm certain it will have to be called there and then any time you need to update binds on new elements brought in by Ajax
-
ysuran got a reaction from idesignwebsites in Ajax Problem with removing and reinserting contentcan you post the html you are bringing back from the server and I'll have a little play with it?
Seems kind of odd that it still doesn't pick up the new elements once you have recalled the function.
-
ysuran reacted to cibgraphics in Developing a mobile siteI use jQuery mobile on my site and it is nice if you need to get something done quick and dirty or if the page has too much content to effectively do a responsive page. With responsive layouts everything still gets loaded regardless if you display them or not. So if you have more content than the weight of the jQuery libraries, then it might be a better option for you.
-
ysuran reacted to MikeChipshop in Developing a mobile siteSecond the above post.
Nothing worse than making a restricted version of a website and calling it 'Mobile version'
-
ysuran reacted to Renaissance-Design in Developing a mobile siteTBH, I'd suggest using a responsive layout rather than a full mobile version.
Wrap your JS calls in a test against screen.width to load efficiently.
-
ysuran got a reaction from zed in Change Image without Reloading Pagethis could be done with pure css no need for the javascript
Check out this link there is one on there. Just google css photo gallery I'm sure you'l find plenty of others.
-
ysuran got a reaction from mantis in CSS worriesGlad I could help
Yeah it was a case of floating the parent element and displaying the child element as a block element.
The problem with the pointer was you were absolute positioning it which will position itself in relation to the last positioned parent element in the dom tree. If it doesnt find one then its positioned in relation to the browser window I think. So setting the li with position:relative it relates to that element and will be bound within in it.
Hope that makes sense
-
ysuran got a reaction from mantis in CSS worriesyou might have already tried this but trying it out with firebug i just adjusted the css to:
.miniprintbox { border: thin dashed #EE0000; float: left; height: 230px; position: relative; width: 380px;} .miniprintbox a.single_image { float: left; height: 230px; width: 200px;} .miniprintbox a.single_image img { display: block; margin: 0 auto;} a.single_image:hover:after { content: url("../images/zoom.png"); height: 25px; position: absolute; width: 25px; z-index: 999; top: 25%; left: 25%;}
Then just play around with the top and left on the hover effect to put it in the right place! The images were centered and the the hover image is now positioned to the parent li instead of further up the dom tree
-
ysuran got a reaction from roothost in php includescant you just include the defaults then do something conditional based on url:
require_once($_SERVER["DOCUMENT_ROOT"] . "/toolbar/survey.inc"); require_once($_SERVER["DOCUMENT_ROOT"] . "/toolbar/calendar.inc"); require_once($_SERVER["DOCUMENT_ROOT"] . "/toolbar/news.inc"); if($_SERVER["REQUEST_URI"] == "http://mysite.com/test.html"){ require_once($_SERVER["DOCUMENT_ROOT"] . "/toolbar/test.inc"); }
obviously that would probably be better done in a switch if you have 10 of them.
Not sure if there is any better way of doing this but i'm no expert!
-
ysuran reacted to zed in 50 CSS toolshttp://www.noupe.com/css/50-useful-css-tools-and-generators-for-developers.html -
ysuran got a reaction from SEOAhmed in Alternative to PHP $_SERVER['REQUEST_URI'] ?Maybe a stupid suggestion but what version of php is the server running?
have you tried $_HTTP_SERVER_VARS?
-
ysuran got a reaction from pandad in New EU Cookie RegulationsImagine all of our sites looking like this
-
ysuran got a reaction from David Cook in Couple of thingsumm well yes but i'm pretty sure that form should actually be inside of the last col div?
so what you end up with is:
<div class="wrapper dark"> <div class="col"> about content here </div> <div class="col"> hire me content here <div class="col last"> email form here </div> </div> <div class="wrapper"> <div class="footer"> footer content here </div> </div>
You may just have to give the wrapper div a height:100% so it spans the entire height of the elements inside either that or use a clear div if that fails.
-
ysuran got a reaction from kanger in Z-link confusion and hover states not workingIf you remove the z-index from:
#pagewrap
.morebutton
Then increase the z-index on #ribbon to 1 it should display properly.
Forgot to say you can probably also remove the positioning on the pagewrap and morebutton as well.
I always try to avoid negative z-inexes unles you really have to push things backward because it isnt really necessary. If you think of a site in layers you work from the bottom and build up.
cheers
Ysuran
-
ysuran got a reaction from HTML/CSS Newbie in Designing a Children's Nursery Site - Laws on PhotosNope can't find my copy but the link below pretty much covers it:
link
Its an official county site so the information can be trusted.
Absolutely image consent should be dealt with by the nursery owner in theory parents will have already signed image consent forms and they will need to check the images before sending them to you. I would make sure that you make sure to mention it in your terms and condition just to cover yourself though.
I'm pretty sure it is all part of the data protection act 1998 if you fancy a fun read
-
ysuran got a reaction from HTML/CSS Newbie in Designing a Children's Nursery Site - Laws on PhotosHi I currently work in a secondary school and am sure that the principles will be the same - any image of a child displayed on a website needs to have the parent's consent to be shown and it is also policy never to give full names in any descriptions used.
There is a publication from Becta or similar government organisation which gives a good idea of the does and don'ts but i cant seem to find my copy at the moment will dig it out and post it up for you as soon as I can
Ysuran