|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
Muppet has asked Wombat something about web push notifications - a topic they both know next to nothing about.
Q: who knows even less than who?
Wombat
you cannot push something to a 'normal' user .. their modem/router firewall will block it. So it is a sort of fiddle... one way or another you have to get the user to install some sort of program. I gather browsers are maybe going to add some sort of such facility...
Muppet
This is precisely what you can do now... look up "Web push notifications" - it's all the rage.
You have to get permission from the user (browser), but that's all.
Wombat
well if the browser has now got that option...
yes... it looks like a push to the user... but actually the pushed messages are stored 'somewhere' and your browser pulls them
Muppet
No... there is a push...
Wombat
yes from your end you just push ... but the browser has to actively retrieve them
you cannot push a message into a user's PC .. well not unless they set their firewall to always accept unexpected messages
Muppet
Your browser is not constantly polling the server in case there's a message for it... the server tells (pushes to) your browser it has a message for it
Wombat
no it cannot! it simply won't get past the router .. unless something is telling the router it wants it
the messages will just sit there waiting if the user's browser is offline
Muppet
of course it can get past the router - all routers are open to web traffic
Wombat
because your browser has sent out a message .. and the router will accept a response from whoever the message went to.. within a time limit
Muppet
and these ntofiicatsion work by your broswer telling the server it will accept pushes from it - this is why you have to subscribe to them
Wombat
yes.. but the brower still has to ask for them! .. if you just fire a message at a router... how does it know which of many computers using it should get that message
Muppet
it knows by which browsers are signed up to accept them
Wombat
no.. the router has no idea what program is using it
Muppet
so how does the browser know when to ask for a message then?
Wombat
becasue when you tell it to allow notifications - from a specific source ... it remembers that and asks occasionally.. i think the default timeout for the router is about 15 seconds.
Muppet
no - I am 100% sure that isn't how it works
Wombat
it will be interesting to time how promptly the notification appears
Muppet
anyone can simply poll a server on a timer
Wombat
a server.. yes!
Muppet
you don't need any fancy new protocls for that
i mean any browser can poll a server using a simple javascript timer
Wombat
but servers have to set their firewall to always pass messages by Port number to specific PCs
but you cannot poll me, or my router
Muppet
You read up on these a bit more and then come and tell me I'm wrong!
Wombat
actually there is a protocol to poll my router ... but they are no longer used because bad guys cause too much trouble.. so no router now will respond to a ping
Muppet
dinner time...
Wombat
but i'd bet you a rhubarb pudding i am right
|
|
|
|
|
I have the following code:
<div style="width:100%;height:100px;clear:left;background-color:#aaddee;border-style: solid;border-width: 1px;float:left;">
<div style="width:100px;height:100%;background-color:#ffeaae;border-style: solid;border-width:3px;text-align: center;vertical-align:middle;">
Tuesday
2023-03-15
</div>
</div>
Why this code doesn't center the text at middle on vertical direction ?
modified 4 days ago.
|
|
|
|
|
The parent div would include several divs, where the text will be aligned separately.
|
|
|
|
|
I have tried:
<div style="width:100%;height:100px;border: 1px dashed #4b2869;clear:left;">
<div style="width:100%;height:100%;display:table;">
<div style="width:100px;height:100%;border: 2px dashed #4f2869;vertical-align:middle;text-align:center">
Tuesday
2023-03-15
</div>
</div>
</div>
No work.
|
|
|
|
|
|
Yes, I know, but the trick is that the second div has no vertical correct alignment, and I don't realise why:
<pre><!DOCTYPE html>
<html>
<head>
<title>Horizontal and Vertical alignment</title>
<style>
.container {
height: 200px;
width: 400px;
border: 2px dashed #4b2869;
display: table-cell;
text-align: center;
vertical-align: middle;
position: relative;
}
.container1 {
height: 200px;
width: 400px;
border: 2px dashed #4b2869;
display: table-cell;
text-align: center;
vertical-align: bottom;
position: absolute;
}
</style>
</head>
<body style="background-color:#646464;">
<div class="container">container</div>
<div class="container1">container1</div>
</body>
</html>
|
|
|
|
|
Sorry, I have tried a number of different styles and combinations but cannot get it to do what you want. But as I mentioned, I am not a CSS expert.
|
|
|
|
|
Thank you Richard a lot. As you see, the vertical alignment of the second div is not correct, and I don't know why, I am not a web developer at all.
|
|
|
|
|
I'm afraid I only dabble so my knowledge is limited. You might try opening the same question in QA to see if it gets a better response.
|
|
|
|
|
Hi,
It is my intention to build a site shop for a photographer but I have no idea which would be the next appropriate language to focus on learning to get the job done out of Javascript or PHP.
What with other work commitments, I don't have the time to learn enough of both languages before the intended date of the site going live at the beginning of December.
I'm hoping that if I give you an outline of the kind of functionality I want you will be able to point me in the appropriate direction:
The photographer in question has a vast number of images they wish to sell as singles, or in sets of three for a reduced price in comparison to buying singles.
The images will be displayed in categories, each of which has the potential to run into a number of pages.
Customers are to be free to choose any image from any page of any category to make up their purchases.
I don't currently want to build a login and members capacity so that session data (the selections made) can be stored and come back to at a later date.
For now I want to be be able to allow customers to, on a single session basis, select as many images as they wish and then preview their selection prior to adding their final choice/s to a basket ready to check out.
I also want to be able to ensure that if there is a session in which a customer previews their choice, sees they have eight images selected, for example, and want to choose one more - in order to benefit from the set of three price, that they can go back to continue shopping without loosing the selections they had made prior to going to the preview page.
In terms of the shopping basket I cam across a paypal specific script that can be incorporated into html without the need to therefore build a php and mysql basket into the site.
I anticipate that I will have to use radio buttons or check boxes for customers to be able to make their selections prior to previewing them. But is it possible, or feasible for a form to span all the category pages and their sub pages?
Thanks in anticipation of you consideration and response
|
|
|
|
|
Member 15952980 wrote: to get the job done out of Javascript or PHP. You probably need both: PHP runs in the server to do the backend work, while Javascript runs in the browser to manage the actual presentation (and data capture, etc.) of the web page.
You might be better looking into something like Wordpress which has many templates that you can adapt to your own needs.
|
|
|
|
|
Thankyou Richard.
Reguarding using Wordpress, I'm confident with HTML and CSS and was hoping to hand code the whole site to avoid generating lots of code I don't understand, and therefore wouldn't be able to debug more easily.
Are you familiar with Wordpress? (I've never used it but know it is avaialable as part of the hosting package I purchased for a HTML site I built)
If so do you envisage it being buggy within the context of the functionality I want?
|
|
|
|
|
Member 15952980 wrote: If so do you envisage it being buggy within the context of the functionality I want? I have not used Wordpress myself, but I know it is in wide use. As to whether it would be buggy, there is only one way to answer such a question.
|
|
|
|
|
Fair point. It may well be my best bet for now given the timeframe I have to work to.
|
|
|
|
|
I need to do a small html code that looks like this: Imgupx - Upload and share your images[^]
I have tried some code, but it doesn't work:
<div>
<p>ER</p>
<img src="C:\Users\myname\Downloads\cici.png"/>
<p>341 Ohm</p>
<p>EN</p>
<img src="C:\Users\myname\Downloads\bibi.png"/>
<p>356</p>
</div>
|
|
|
|
|
For a personal web page only accessed from the same PC as the one it is being served from, you will have to use the 'file:' protocol (like http: / https: for remote sites). As you have it, it is looking for the 'C:' protocol - this is not a defined protocol. IIRC, the ':' after the 'C' needs encoding as a | e.g.
<img src="file:C|\Users\myname\Downloads\cici.png"/> For a web page accessed from a different location, you will have to save the images in a special folder (details vary based on the web server software - see your documentation) and the name will be relative to that server's root (and, in that instance, you can skipped putting the protocol component).
|
|
|
|
|
The image is for testing purpose only, the fact is the html page is like in the image: Imgupx - Upload and share your images[^]
How can I arrange multiple text and image anxt again like the image reveal ?
|
|
|
|
|
I have made it:
<div style="float:left;">
<p>ER</p>
<img src="C:\Users\myname\Downloads\cici.png"/>
<p>341 Ohm</p>
</div>
<div style="float:left;">
<p>EN</p>
<img src="C:\Users\myname\Downloads\bibi.png"/>
<p>356</p>
</div>
|
|
|
|
|
How can I list several div's tags with the following pattern ?
Untitled hosted at ImgBB — ImgBB[^]
I have tried something like this:
.title{
display: inline;
}
.icon{
display: block;
}
.item-text{
float: right;
}
<div class="item-main">
<div class="title">
My title
</div>
<div class="icon">
<img src="...">
</div>
<div class="item-text">
Lorepsum imte ...
</div>
</div>
but don't work correctly.
modified 6-Mar-23 9:29am.
|
|
|
|
|
If you want the text to wrap, then float the image:
.title {
display: block;
}
.icon {
float: left;
margin-inline-end: .5em;
margin-block-end: .5em;
}
.item-text {
}
Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Excellent, and if I would list several times that pattern, one under another ?
I did:
<div>
<div class="title">
Introduction To XHTML 1.0
</div>
<div class="icon">
<img src="http://dummyimage.com/200x200/f0f/fff" />
</div>
<div class="item-text">
Topics includes: Introduction To XHTML 1.0,
Introduction To Tag and Attribute Syntax,
Introduction To Element Content Syntax,
Document Structure and Head Level Tags,
Body Tag and Block Level Tags,
Understanding In-line Elements and Tags, etc
</div>
<div class="title">
Introduction To XHTML 2.0
</div>
<div class="icon">
<img src="http://dummyimage.com/200x200/f0f/fff" />
</div>
<div class="item-text">
222 2222 Topics includes: Introduction To XHTML 1.0,
Introduction To Tag and Attribute Syntax,
Introduction To Element Content Syntax,
Document Structure and Head Level Tags,
Body Tag and Block Level Tags,
Understanding In-line Elements and Tags, etc
</div>
</div>
but the pattern its not listed one under another.
|
|
|
|
|
Add clear: both; to the .title rule:
.title {
display: block;
clear: both;
} Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you a lot Richard ! It works !
|
|
|
|