Hi guys here’s avinash and additionally, you will very successfully be welcome to 1 other video of straight forward tutorials youtube channel this day on this video we can witness ideas to do a online internet page the assign additionally, you will upload an image and write the textual reveal material on the image actual like social media put up or social media reports additionally, you will perceive on this webpage if i click on on this upload icon.
We’ll lift out any image let me lift out this one and click on on on open so that additionally, you will perceive this image on the earn internet page let's click on on this icon all as soon as more and let me opt the one other image and click on on here additionally, you will perceive the 2nd image on this online internet page so here’s the absolute top diagram to upload an image to your online internet page and here additionally, you will perceive a.
Textual reveal material called add caption here we can add any message so let's add additionally, you will perceive whatever textual reveal material i’m writing on this textual reveal material field that is showing over this image so here’s the absolute top diagram to upload image and textual reveal material actual like the social media put up or social media reports so we can are attempting this online internet page the usage of html css and quite straight forward javascript so let's.
Commence up this video here on this folder i own added one index.html file one style.css file and each other folder called photographs and here i own this upload icon and two a spread of photographs that i shall be importing on this online internet page you will get dangle of all these photographs download hyperlink within the video description now let me open these recordsdata.
With my code editor which is visible studio code additionally, you will dispute any code editor so here’s the html file the assign i own added overall html constructions and this one is the css file the assign i own added margin padding font household and field sizing these css properties shall be appropriate for the total html parts on this html.
File i own added this hyperlink heed that will connect the html and css file because i own added style.css it’s miles the file title of the css file next we can add the code within the body heed so here we can do one dip with the class title container next now we want to add the css for this one so actual add this class title here within the.
Css file and here we can add the background then color this would maybe maybe also be the textual reveal material color let's add the background dimension background dimension shall be covered.
And background residing this would maybe maybe also be heart next we can add width for this container so let me add the max width this would maybe maybe also be 450 pixel and top this would maybe maybe also be 100 vh margin shall be auto so that this would maybe just.
Be horizontally heart and let me add residing relative after including this let's arrive support to the folder and open this html file with any internet browser so that additionally, you will perceive this darkish color within the guts the width is 450 pixel and the tip is 100 vh it methodology 100 viewport top let me stop this browser and that i will open this webpage.
With the visible studio code extension called live server so that this would maybe just refresh the on-line internet page routinely each time we can add any adjustments within the code file now additionally, you will perceive the same internet sites let me alternate the display veil dimension so here’s how this would maybe just expose on a smaller display veil so let me arrive support to.
The html file here now we want to add one textual reveal material space the assign we can type the textual reveal material so let's add one textual reveal material space write the id textual reveal material field placeholder this would maybe maybe also be add caption after including this let's open the webpage and additionally, you will perceive this input field at top left nook so now we want to alternate its residing and now we own.
To purchase away these borders and background color so let's arrive support and duplicate this textual reveal material space arrive support to the css file here we can add this id with the hashtag because it’s miles an id so let's add the residing absolute left shall be 0.
And bottom 0 so this would maybe maybe also be on the bottom now the width for this textual reveal material space shall be 100 water shall be none and define none.
Then we can add the background background shall be clear and color this would maybe maybe also be white so after including the css for the textual reveal material field let's refresh the earn internet page additionally, you will perceive this add caption on the bottom let me add some padding here so here we.
Will add padding 10 pixel so that additionally, you will perceive some area here if i write one thing here it’s miles showing internal this input field so now we want to expose this textual reveal material anyplace on this online internet page so for that enable's arrive support to the html file.
Here we can add one div with the id priv textual reveal material which is preview textual reveal material so whatever textual reveal material we can write on this textual reveal material space that shall be displayed on this div which is brief textual reveal material now to expose this textual reveal material on this div here we can add one script so let's add script heed.
In this script we can add this textual reveal material field correct the assign textual reveal material field equal to narrative dot salvage element by id and the id is textual reveal material field because now we want to salvage the textual reveal material from this input field which is textual reveal material space now here we can add textual reveal material field.
Dot on key up equal to textual reveal material field dot on key residing equal to characteristic and on this characteristic we can write the.
Code that will expose the textual reveal material written internal this input field within the preview textual reveal material so here we can add this preview textual reveal material let's add narrative dot salvage element by id preview textual reveal material dot.
Internal html equal to this dot price that's it after including this let's refresh the earn internet page if i write one thing on this textual reveal material field that is showing on the tip so now we want to alternate its residing and we.
May even alternate its dimension let's arrive support and let's reproduction this preview textual reveal material and add it here within the css file here we can add residing residing shall be absolute left.
50 and bottom this would maybe maybe also be 30 then we can add change into translate x minus 50 then we can add the width which is able to be.
90 p.c font dimension shall be 32 pixel textual reveal material align heart and we could add textual reveal material shadow after including this let's arrive support to the earn internet page and additionally, you will perceive this textual reveal material at this residing and the font dimension has been.
Elevated let me purchase away this textual reveal material now now we own added the feature to expose the textual reveal material on this online internet page next now we want to expose the image first we can add one upload icon and if i click on on this upload icon it would possibly per chance maybe maybe composed upload one image and that image shall be displayed on the on-line internet page so let's arrive support.
And here after this textual reveal material space we can add one input field input and input type shall be file that's it and here now we want to add bag.
In this bag now we want to jot down which make of file this would maybe just bag so let's add image prick open so this would maybe just upload any make of image file title this would maybe maybe also be image and write the id id shall be file and.
After including this let's arrive support to the on-line internet page additionally, you will perceive here we can upload one image there's an option opt file let's click on here and this would maybe just search recordsdata from you to come to a decision on the file so if i lift out someone nothing will happen here additionally, you will perceive.
Image2.png the title of the chosen file that's it image1.png like this but it’s not showing on the on-line internet page so first now we want to hide this one it would possibly per chance maybe maybe composed not expose here so let's arrive support and here we can add.
Designate for file it must be same here id file and for file and on this stage let's add upload additionally, you will perceive one textual reveal material here upload on the agreeable aspect if i click on on this textual reveal material it’s miles in overall doing the same part it’s miles asking to come to a decision on the file.
Now we can upload the image by clicking on this textual reveal material which is upload so we can hide this button which is opt file so let's arrive support and on this input we can add style expose none after including this.
You would possibly want to perceive that opt file is hidden we can simplest perceive the upload textual reveal material and if i click on here it’s miles asking to come to a decision on the image and now now we want to substitute this textual reveal material with the icon that is upload icon so let's arrive support and moderately than this textual reveal material we can add one icon so we can add img.
Mark img file course write the file course photographs prick upload dot png so now we own added one upload image here additionally, you will perceive this upload image next now we want to alternate the residing and dimension for this image so let's arrive support and here we can add one class title upload icon.
Reproduction this one and arrive to the css file here we can add this with the dot upload icon and write residing absolute then we can add width width shall be 60 pixel then.
Bottom 100 pixel and left 50 p.c change into translate x minus 50 so that this would maybe maybe also be horizontally centered and after that we can add cursor pointer.
Now additionally, you will perceive this icon at this residing and if i click on on this icon it’s miles asking to come to a decision on the image and all as soon as more if i lift out any image nothing is going down so now now we want to expose the chosen image on this background for that enable's arrive support on this input field we can add one occasion.
So let's add on alternate on alternate equal to load file occasion on this input now we own added on alternate equal to load file occasion and now now we want to.
Display the image on this div which is container so with this container we can add one id also so the id is img field the assign we can expose the image so after including this id and this on alternate let's arrive support on the bottom and after this variable we can add one other variable so let's duplicate this.
One and here we can add this img field paste it here the assign img field equal to narrative.getelementbyid img field now reproduction this load file and here.
After this characteristic we can add the assign load file equal to characteristic occasion and on this characteristic now we want to add img field.
Dot style dot background image now we want to add the image within the background here we can add code url and plus plus quote.
This and internal this plus now we want to add the hyperlink of the image that is uploaded by means of the upload icon so that you just can salvage the hyperlink here we can add url dot do object url occasion.
Dot purpose dot recordsdata that's it url do object url occasion dot purpose dot recordsdata 0 this would maybe just give the url of the image file uploaded by means of the upload icon and this would maybe maybe also be displayed on this image field as a.
Background because now we own added a mode dot background image now let's refresh the earn internet page and if i click on on this upload icon and lift out the image additionally, you will perceive this image within the background now click on all as soon as more and lift out the one other image additionally, you will perceive one other image within the.
Background now if i write textual reveal material here additionally, you will perceive the textual reveal material written on this input field showing over this image so at final now we own created this internet do to upload put up or social media reports on the earn internet page i am hoping this video shall be precious for you whilst you own any query additionally, you will search recordsdata from me within the comment share.
Please like and fragment this video and as well subscribe my channel straight forward tutorials to peek more videos like this one thank you so great for watching this video