You could go up to the Marquee tool Options bar and at Style, change it from Normal to Fixed Size and enter the pixel width and height. 210 w x 1 h Set Feather to 0 px or the line looks blurry.
Then from Photoshop's color picker, enter the hex value to set the foreground color.
Use the Alt + Delete keyboard shortcut to fill that rectangle with the foreground color wherever you position the rectangle.
i am trying to use the rectangular marquee tool to make spaces in my text. im making a side nav bar for a website for a family member.
so i need to add in dviders to go between each text link.
Just a thought: Since the end goal of this exercise is making components for a webpage, you'd be better off creating your dividers and whitespace using Cascading Stylesheets (CSS) using whichever web editor you use.
One feature of navbars on webpages is that they're prone to change over time and it's far easier tweaking text rules in a stylesheet than re-visiting Photoshop to create new graphics every time you want a small change in the nav bar.
How would I do this?
Hard to explain in a single forum post.
Best if you upload your site to the web and post a link.
Then it's a matter of creating a CSS-based navbar (there are plenty of tutorials - and tools/utilities to make the process easier - online) and tweaking the CSS rules to taste
One example: http://css3menu.com
All this is strictly off-topic for a Photoshop forum, of course. Which web editing software do you use? Perhaps take the discussion there.