Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Nectarine;44233263]I'm wanting to make a simple web control panel for my minecraft server, are there any good tutorials or guides on how to get started?[/QUOTE]
You're most likely going to have to learn PHP or something similar.
[QUOTE=josm;44233599]You're most likely going to have to learn PHP or something similar.[/QUOTE]
Okay, I'll have a go. Thanks
I'm working on my first "real" website.
So far I managed to get get everything running with Angular, but I can't seem to get the text on a <a> button vertically centered.
[url]http://ananke.me/[/url]
Does anyone know how to do that?
[QUOTE=LennyPenny;44245518]I'm working on my first "real" website.
So far I managed to get get everything running with Angular, but I can't seem to get the text on a <a> button vertically centered.
[url]http://ananke.me/[/url]
Does anyone know how to do that?[/QUOTE]
You set the line-height as the height of the element. It has to be absolute though, or you use flexbox
Awesome, fixed it with this flex thingy.
Why does all this have to be so hacky :suicide:
[QUOTE=LennyPenny;44245657]Why does all this have to be so hacky :suicide:[/QUOTE]
Welcome to web development
where it's easier to just display:none something than actually fix the code
It shouldn't really be hacky unless you have a complex design. Most likely there is fucked up CSS or HTML somewhere, unfortunately I can't see the webpage source on my iPhone :downs:
Hey guys, I'm trying to help out a friend of mine with html practice, and our problem right now is that we need to get a div container to automatically scale to what's inside of it, in this case a blue background box automatically scale to fit small boxes within it.
looks like this:
[IMG]http://i.gyazo.com/8448dc84b7e1f3fce3b2dac443f46fb0.png[/IMG]
it needs to be able to dynamically scale across multiple pages to different sized boxes, with a certain amount of pixel buffer. We've already tried stuff like overflow and a couple other more manual solutions, but nothing seems to be working. would somebody mind taking a look to see how we could solve this?
code here:
[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#contentbox {
background-color: #CFF;
max-height: ;
width: 900px;
margin-right: auto;
margin-left: auto;
position: relative;
padding: 5px;
float: none;
}
#greenbox {
background-color: #693;
height: 200px;
width: 400px;
position: absolute;
left: 30px;
top: 50px;
float: left;
}
#orangebox {
height: 500px;
width: 400px;
position: absolute;
left: 470px;
top: 211px;
float: right;
background-color: #F63;
}
#yellowbox {
background-color: #FC9;
height: 150px;
width: 400px;
position: absolute;
float: right;
left: 470px;
top: 50px;
}
#purplebox {
background-color: #669;
float: left;
height: 200px;
width: 400px;
position: absolute;
top: 260px;
left: 30px;
}
#body {
margin: 0px;
{
.clear {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
</style>
</head>
<body>
<div id="contentbox">
<div id="greenbox">Content for id "greenbox" Goes Here</div>
<div id="yellowbox">Content for id "yellowbox" Goes Here</div>
<div id="orangebox">Content for id "orangebox" Goes Here</div>
<div id="purplebox">Content for id "purplebox" Goes Here</div>
<div class="clear"></div>
</div>
</body>
</html>[/CODE]
What's up with your CSS? Your contentbox has a missing max height:
[code]max-height: ;[/code]
and your body css tag has the wrong end bracket
[code]
#body {
margin: 0px;
{
[/code]
Also just a general HTML thing I'd recommend you change your doctype to
[code]
<!DOCTYPE html>
[/code]
And change the starting html tag to just <html>
[QUOTE=LennyPenny;44245657]Awesome, fixed it with this flex thingy.
Why does all this have to be so hacky :suicide:[/QUOTE]
[t]https://vault.skarphet.com/74Gp1N[/t]
[QUOTE=alexanderk;44254305][t]https://vault.skarphet.com/74Gp1N[/t][/QUOTE]
#nav is with "height: 25%;" that is translated to "I don't care about your content and if the content is >25% if I'm gonna overlap them.
I just hate using fixed values.
The overlapping only came into place when I had to set the position type of the ng-view div to be "absolute" instead of "relative" because that was causing the transition of the different views to be weird.
If anyone knows a fix other than making the nav of a px height let me know. (I made it px for now)
I'll work on adding some dummy content today to get the design across.
Making something absolute stops other objects from "colliding" with it so they'll overlap
any suggestions to how i should go about creating a "fake" webstore?
might sound dumb, but i'm trying to do some metagame stuff
basically need a web store that people can add items to a cart as per usual, but on check out it'd send an email with the stuff in the cart and the "buyer's" information
[QUOTE=venom;44261911]any suggestions to how i should go about creating a "fake" webstore?
might sound dumb, but i'm trying to do some metagame stuff
basically need a web store that people can add items to a cart as per usual, but on check out it'd send an email with the stuff in the cart and the "buyer's" information[/QUOTE]
do exactly what you said
[editline]17th March 2014[/editline]
unless you mean "is there any software that can do this for me", in which case you can take any shopping website package and edit it a bit
sorry, totally new to the web design thing
what'd be the easiest/cheapest way to accomplish this?
[QUOTE=venom;44262670]sorry, totally new to the web design thing
what'd be the easiest/cheapest way to accomplish this?[/QUOTE]
Use something like OpenCart, and create a new payment module that just sends the email.
This might help: [url]http://www.mzcart.com/open-cart-how-to-create-a-payment-module-for-open-cart/[/url]
[QUOTE=scroul;44224550]I want to get in to Ruby on Rails because i now asp.net and MVC but i feel that i could be nice to now something thats not windows related. So do anyone have any tips any good tutorials on the basics on Ruby on Rails.[/QUOTE]
Not sure if it's good but i saw that Codecademy had a section on Ruby, might be worth checking out.
[QUOTE=LZTYBRN;44254072]Hey guys, I'm trying to help out a friend of mine with html practice, and our problem right now is that we need to get a div container to automatically scale to what's inside of it, in this case a blue background box automatically scale to fit small boxes within it.
looks like this:
it needs to be able to dynamically scale across multiple pages to different sized boxes, with a certain amount of pixel buffer. We've already tried stuff like overflow and a couple other more manual solutions, but nothing seems to be working. would somebody mind taking a look to see how we could solve this?
[/QUOTE]
Try taking a look at CSS Flexbox if you don't mind lack of backwards compatibility.
[URL="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes"]MDN link[/URL]
Does anyone know why icon fonts, for e.g. flat-icons doesn't work in .... (wait for it) ..... IE?
What do you mean they don't work? It's just displaying a normal font? The font might need to be in a certain format for IE
[QUOTE=djjkxbox360;44269830]What do you mean they don't work? It's just displaying a normal font? The font might need to be in a certain format for IE[/QUOTE]
The font doesn't render in Internet Explorer (It doesn't appear at all). I'm quite confident there's nothing wrong with the font. This is how the current font-face set-up looks like:
[code]
@font-face
{
font-family: "Flaticon";
src: url("fonts/flat-icon/flaticon.eot");
src: url("fonts/flat-icon/flaticon.eot#iefix") format("embedded-opentype"),
url("fonts/flat-icon/flaticon.woff") format("woff"),
url("fonts/flat-icon/flaticon.ttf") format("truetype"),
url("fonts/flat-icon/flaticon.svg") format("svg");
font-weight: normal;
font-style: normal;
}
[/code]
Is there any drag and drop tool to visualize a bootstrap site design? I dont need it to output the html or anything like that, I purelly want to see what it would look like without having to mess with ps/gimp
[QUOTE=KmartSqrl;44219667]I'd remove the background from the html tag and only apply it to your body tag, set your body's margin and padding to zero and it's height to 100%
[/QUOTE]
this worked! thanks!
So I have a bunch of random quotes that show up as a slogan on my homepage
[code]
<?php
$quotes = array( "One quote", "And another" );
$rQuote = rand(0, count($quotes) - 1);
$quote = $quotes[$rQuote];
echo $quote;
?>
[/code]
Some are NSFW, some are SFW. I'm going to have a cookie saved for when a user wants nsfw to be shown. Ill figure out that logic myself since I'm not ready to go full mySQL for user-settings (yet)
However this is the worst kind of hack-code.
What I need is NSFW and SFW quotes to show up (when NSFW is enabled) and not have it read an array with both :P To do that with the current code would be even hackier than what is already written.
So I am thinking I want a database (flatfile or sql) of different quotes and phrases to be spit out, and have a category assigned to them.
If I wanted to get a random quote out of mysql it would grab all strings matching NSFW and SFW categories, but If I wanted an insult for example for incorrectly inputting a password, those strings could be in the same database but not be read due to them being in the separate "insults" category.
I don't necessarily need mySQL to do this (yet) I was originally going to ask if I could get help with PHP reading quotes from single lines in a file etc, but I think that would cause alot of me looking stupid.
So FP what is the "right" way to do this?
Also with this function, is it actually random? I swear to god it shows some more often than others... (I use the same function with a foreach files in directory to get random images)
[QUOTE=lkymky;44273174]Also with this function, is it actually random? I swear to god it shows some more often than others...[/QUOTE]
its pseudorandom.
[QUOTE=lkymky;44273174]So I have a bunch of random quotes that show up as a slogan on my homepage
[code]
<?php
$quotes = array( "One quote", "And another" );
$rQuote = rand(0, count($quotes) - 1);
$quote = $quotes[$rQuote];
echo $quote;
?>
[/code]
I don't necessarily need mySQL to do this (yet) I was originally going to ask if I could get help with PHP reading quotes from single lines in a file etc, but I think that would cause alot of me looking stupid.
So FP what is the "right" way to do this?[/QUOTE]
<?php
$quotes = array('quote', 'quote');
if (isset($nsfw) && $nsfw == true){
$nsfw_quotes = array('shit','fuck');
$quotes = array_merge($quotes, $nsfw_quotes);
}
echo $quotes[rand(0, count($quotes) - 1)];
?>
@lkymky
[code]
$quotes = array('One quote', 'And another');
shuffle($quotes); // re-order the quotes array
$quote = reset($quotes); // get the first value in the array
[/code]
Random numbers can repeat, they have no memory of what came before, it's only at a significantly large sample they actually level.
[code]
session_start(); // remove if you've already called this
$quotes = array('One quote', 'And another');
// if no session is set start at a random position in the array
if(!isset($_SESSION['quote_index'])){
$_SESSION['quote_index'] = rand(0, count($quotes)-1);
}
$quote = $quotes[$_SESSION['quote_index']];
$_SESSION['quote_index']++; // Increment position
// If the index is longer than the number of quotes set back to zero
if($_SESSION['quote_index'] == count($quotes)){
$_SESSION['quote_index'] = 0;
}
echo $quote;
[/code]
This code will start at a random position and then cycle through the quotes. There are other ways to make this more random though.
Not really a question, more of a request, but I just need people to play around on my unfinished site to generate some analytics data for a college assignment, there's probably a lot you guys can add to improve it, that would be appreciated as well, but in general just piss about on the site if you could please.
Site here: [url]http://mercialeisure.uphero.com[/url]
Seeing as the only two pages that exist are the homepage and the about page, don't expect the other links to take you anywhere.
Sorry, you need to Log In to post a reply to this thread.